[NTLUG:Discuss] bash Script help

Bobby Wrenn bobby at wrennest.com
Thu Aug 29 13:50:32 CDT 2013


On 08/29/2013 09:41 AM, Fred James wrote:
> 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
>
>
> _______________________________________________
> http://www.ntlug.org/mailman/listinfo/discuss
>
The exit function was it. Program is now complete and ready to ship to 
Papua New Guinea. Thanks to all for the tips. All the little tips 
together led to the answer.

Bobby



More information about the Discuss mailing list