Re: Install Script Feedback
Steve Cookson <[email protected]>
| Newsgroups | gmane.comp.lang.perl.wxperl |
|---|---|
| Message-ID | <[email protected]> |
Hi James,
Actually, I've changed my mind, what about something recursive
like this (I called it test.sh and it calls itself with a file redirect
in it. We just type sh test.sh):
#!/bin/bash
#
if [ -z "$1" ]
then
echo "These directories will be deleted:\n";
#
#
# Put code to list directories here
#
#
read -p "Do you wish to continue? " yn
case $yn in
[Yy]* ) sh test.sh "Y" > testlogfile.txt; exit;;
[Nn]* ) echo "Exit without changing anything."; exit;;
* ) echo "Please answer yes or no.";;
esac
fi
echo "Do all the install work";
#
#
# Put code to install wx here
#
#
echo "Finished.";
What do you think?
Regards
Steve.
On 22-10-2014 18:05, James Lynes wrote:
> Hi Steve:
>
> Attached is the revised script.
>
> I had a problem the first time I ran it as a prompt was asked for but
> not seen as it was sent to the log file. The process hung at that
> point since the prompt wasn't responded to.
>
> So, now I have everything going to both the screen and the log file.
> If you know a better way, let me know. I'd rather not have all the
> compile stuff going to the screen. I am not a shell guru!
>
> I changed the find root directory and added a warning statement also.
>
> James
>
>
> On Mon, Oct 20, 2014 at 4:18 PM, Steve Cookson
> <[email protected] <mailto:[email protected]>> wrote:
>
> Hi James,
>
> On 20-10-2014 21:05, James Lynes wrote:
>
> I don't see where any unrelated packages were effected. It
> seems that it would be prudent to begin the find at /usr/local/.
>
> Your respondent was right. I always loose Flamerobin (the
> Firebird database manager) and have to reinstall it afterwards,
> which is why you see it reinstalling afterwards in some of my scripts.
>
> But of course it may not now that we are only interested in /local/.
>
> If we listed the directories like you have, and warned the user
> (Do you wish to continue, yes or no?). Then the user can realise
> that, for instance, Flamerobin would be deleted before it's too
> late and update the script accordingly.
>
> Regards
>
> Steve.
>
>