[NTLUG:Discuss] bash Script help

Fred James fredjame at fredjame.cnc.net
Thu Aug 29 09:41:52 CDT 2013


Bobby Wrenn wrote:
> On 08/28/2013 04:37 PM, Patrick R. Michaud wrote:
>> On Wed, Aug 28, 2013 at 04:26:32PM -0500, Bobby Wrenn wrote:
>> snip
>> Because of the &, you may need to wait a couple of seconds
>> before letting the script exit, otherwise the parent process
>> may signal the child process to exit as well.
>>
>> But even better might be to not use an & at all, and simply do
>>
>>      exec ./FactoryRestore.sh
>>
>> This replaces the current shell with ./FactoryRestore.sh
>> without creating a new process.
> Well it turned out to be a combination of two problems.
>
> 1. I should not use the & at the end
> 2. the factory restore script needed to sudo. So I added the user to 
> sudoers with no password and prepended the call with sudo.
>
> Now all I need to do is figure out how to do an "exit this dialog" 
> button. Any ideas?
>
> Bobby
Bobby Wrenn
I should assume the "dialog" is text, not GUI?

(countdown script
call to FactoryReset script)
wait    # forces a wait until called script completes
(echo something about process complete)
echo "press enter to exit"
read Ans
exit 0

Does that help?
Regards
Fred James




More information about the Discuss mailing list