Script stops running the remaining checks after becoming admin


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Script stops running the remaining checks after becoming admin
# 1  
Old 02-12-2009
Script stops running the remaining checks after becoming admin

Hi all,

I encountered a problem where my script stops running the remaining checks after becoming an admin that is written within the script.

For example:
=========================================
#!/bin/sh
check 1 # Runs successfully
check 2 # Runs successfully
/com/bin/admin # Becomes admin, this is how we switch to admin user
check 3 # Does not run
check 4 # Does not run
=========================================

Sample output:
Check 1 output
Check 2 output

[admin@hostname] $

# From here it will not continue the rest of the scripts until I type "exit"

Please advise.
# 2  
Old 02-12-2009
Sorry, just want to make it clearer
For example:
=========================================
#!/bin/sh
check 1 # Runs successfully
check 2 # Runs successfully
/com/bin/admin # Becomes admin, this is how we switch to admin user
check 3 # Does not run, this needs to run using admin access
check 4 # Does not run, this does not need admin access
=========================================

After type exit, only the one that does not need admin access will run. That's the reason why I need to switch it to admin first.

Thanks.
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Copy Script Stops

Good Morning, I have a copy script on Solaris 9 machine that is supposed to copy some files to a NAS using: cp -r /dir/dir/ /dir/dir/dirThe script doesn't finish. The directory contains user files of which one seems to copy fine, a second was failing until I did achmod -R -777 to it. Now,... (6 Replies)
Discussion started by: Stellaman1977
6 Replies

2. UNIX for Advanced & Expert Users

Need a exit from sftp if its ask for password and continue to run remaining part of script.

Hi I am checking status of sftp in Health check script, sftp command is used to connect the server with secure RSA key, which is successfully get connected most of the time but in some case if RSA key ask for password then I need to exit sftp command after few second and continue to run... (1 Reply)
Discussion started by: ketanraut
1 Replies

3. Shell Programming and Scripting

Script function which checks if itself is already running

Hi All, I have a cron job set up which is set to run every 10 seconds. What I need to do is have the script do a check to see if it is already running such that if it is running it wont fire up additional instances and processes according to its normal process. For example if I have a script... (4 Replies)
Discussion started by: landossa
4 Replies

4. Shell Programming and Scripting

Script to do the following checks

Hi , I need a script for processing below scenario. I have to check daily by doing ftp IP to check it is logging or not. So i want this activity to be automated such that if login succesful i will get "FTP LOGIN SUCCESS" in a log file and if fails i want the error message in the same log... (1 Reply)
Discussion started by: sv0081493
1 Replies

5. Shell Programming and Scripting

Script to performs checks

Hi , I need a script which performs below activity I have one file named "testfile" in 9 different directories with same name. I want to perform below action with each testfile of each directory. if ; then mv listfiles listfiles_`date +%b%y` else echo No Such files fi ... (4 Replies)
Discussion started by: sv0081493
4 Replies

6. Shell Programming and Scripting

Script stops running after assigning empty string for a variable

Hi, This is the first time I see something like this, and I don't why it happens. Please give me some help. I am really appreciate it. Basically I am trying to remove all empty lines of an input.. #!/bin/bash set -e set -x str1=`echo -e "\nhaha" | grep -v ^$` #str2=`echo -e "\n" |... (4 Replies)
Discussion started by: yoyomano
4 Replies

7. Shell Programming and Scripting

[Bash] MD5 Checks with Script.

Hi. I'm triyng to make a Bash Script that checks (recursively) the MD5 from all the files in a certain directory and compare them against some other check that should be already done and saved in a file. I've reached to the point where i have the MD5 from the file and the MD5 that the script... (1 Reply)
Discussion started by: BiFo
1 Replies

8. Shell Programming and Scripting

Script that checks for previous instances running

Hello, I'm trying to write a script that checks for previous instances of the same script which may still be running (this script is scheduled to run every 30 minutes). I want to somehow use the pid from each instance to make sure the previous one isn't running before continuing with my... (5 Replies)
Discussion started by: bd_joy
5 Replies
Login or Register to Ask a Question