Hello,
I have written a script to automate a software install. I am running the script as root, but need to su to another user to configure and complile the program properly. Whenever I do the shell script su's to the user properly but the scripts stops executing until I exit out of the new shell that su put me into. The following is an example of my script.
echo -e "\033[1m \n\t Installing courier-imap... \033[0m"
sleep 2
cd /var/src
tar -xjf tar/courier-imap-2.2.2.20040207.tar.bz2
cd courier-imap-2.2.2.20040207
# build as vpopmail
chown -R vpopmail:vchkpw ../courier-imap-2.2.2.20040207
su - vpopmail
./configure --with-redhat
I have also tried using the following to stay in the same shell and preserve the environment:
su - -m -p vpopmail
Does anyone have any thought as to how I can successfully SU and keep the script running?
Thanks,
Stephen