Script to Reboot and Confirm


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Script to Reboot and Confirm
# 8  
Old 02-17-2011
Simply remove the "break" command Smilie
This User Gave Thanks to bartus11 For This Post:
# 9  
Old 02-18-2011
Hello

@Bartus
I get the following error after removing the "break" command and adding the "cat " to the LIST variable.

HTML Code:
./Reboot.sh[12]: i++: more tokens expected
@alister
I've added the "cat" command to your variable and it works!

Just an additional request, let say I need to re-run the script how would I skip the IPs that already rebooted?

I would think to look first at the reboot log and then continue with the remainder of the script.
# 10  
Old 02-26-2011
I would like to update script further.
Search the specific filenames: /tmp/reboot?_ips and allow the user to input a desired filename to reboot. Additionally, make sure that the name contains 7 chars and the user confirms the correct reboot file by entering the 7th char of the selected filename.

For instance I have the following:

HTML Code:
files in the /tmp directory
reboota_ips
rebootb.ips
rebootc.ips
rebootd_ips
Therefore the script will first Prompt the user with the available reboot files in /tmp directory and allow them type the correct filename and confirm that the 7th char is the actual file they are looking to reboot

HTML Code:
echo From the reboot files found in the /tmp directory please type the correct filename to reboot device and confirm with 7th char.
find . | /tmp/reboot*
I'm pretty sure a CASE statement would do the trick here but need your input.
After the user inputs one of the "reboot?" file, I think the next step would be to append that to this portion of the current script
HTML Code:
 'ips_all="/tmp/$reboot?_ips".'

Last edited by ravzter; 02-26-2011 at 02:30 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Simply Bash Script to Confirm that there are 2 Files in Same Folder

Im looking for 2 Files -> *.WAV and *.wav with find . -name 'unavail.wav' -o -name 'unavail.WAV' I need to list the Folders that contains these 2 Files? Thx in advance (13 Replies)
Discussion started by: valdez
13 Replies

2. Shell Programming and Scripting

Start Script on system reboot

Hi, I have the following script that looks for a certain file and then executes the start.sh file. How can i make this process to kick when the box reboots. Please advice if ; then /u01/Essbase/Oracle//Middleware/user_projects/epmsystem7/bin/start.sh; rm... (8 Replies)
Discussion started by: thinkingeye
8 Replies

3. Shell Programming and Scripting

Remote reboot script

I'm a beginner in shell scripting and doing simple scripts for work requirement. #!/bin/bash for blade in `cat machines.txt` do rsh $blade 'reboot' done but when I try it with root password it's throwing error saying permission denied.We're using same root password for all... (3 Replies)
Discussion started by: ratheeshp
3 Replies

4. AIX

Need to confirm something regarding TL upgrades

Hi everyone, My current AIX OS level is "7100-01-06-1241" and I am planning to upgrade it to " 7100-02-03 ". Can i directly upgrade it to "7100-02-03" from 7100-01-06" ? or first i need to upgrade the "7100-01-06" LPAR to TL 02 and then reboot and then upgrade it to TL 02 SP03 ? ... (4 Replies)
Discussion started by: System Admin 77
4 Replies

5. Solaris

Reboot required on Server, Just confirm my settings.

Hi Guys, I need to reboot one Server as the newly inserted disk is not getting detected in system , I have also confirmed with Sun Support and finally it was the reboot which was required after doing all troubleshooting stuff. So I have disassembled the mirror and kept working disk's single... (3 Replies)
Discussion started by: manalisharmabe
3 Replies

6. Shell Programming and Scripting

Reboot script issue

Hi guys I am troubleshooting a script that informs me when a system has rebooted. The script is placed in /etc/rc3.d folder under root. The script is as follows: . /opt/scripts/function.sh PATH=/usr/bin EMAIL_ADD=<email address> ... (2 Replies)
Discussion started by: Junaid Subhani
2 Replies

7. Shell Programming and Scripting

script to reboot multiple hosts

Hi Expert, How to create a script to reboot multiple hosts in linux? Thank you. (5 Replies)
Discussion started by: regmaster
5 Replies

8. Linux

Run a script during reboot/startup

Hi all, i have a script in /etc/init.d directory. -rwxr-xr-x 1 root root 26 Mar 28 16:00 myscript I need it to run when my linux reboots/startup. However is it not being executed. Do i need to put in in the rc.local directory? (1 Reply)
Discussion started by: new2ss
1 Replies

9. Solaris

different between soft reboot and hard reboot

Hi Guru's Can any want here could explain to me the different between soft reboot and hard reboot . Best Regards Seelan (3 Replies)
Discussion started by: seelan3
3 Replies

10. Shell Programming and Scripting

Confirm before delete.

I have a script that archive files then delete.How do Its working fine,however,before I perform the delete operation,I want to verify that indeed the FILE is in the path of folder I want to archive. For example,I have a path /A/B I want all files in B to be archived,the scripts lists all the... (5 Replies)
Discussion started by: kayarsenal
5 Replies
Login or Register to Ask a Question