I'm not sure that I understand your question then.
You can take the script that Corona688 has posted and place it in the search path (eg, /usr/bin) and it becomes a 'command' that you can call from the CLI.
If we're on the wrong track please clarify.
Also, I assume that you have root access to do this?
Basically was looking for some confirmation option with command reboot / shutdown to avoid accidental reboot of server alike with copy and remove commands
but as said by corona688 that reboot is not interactive so will try to put the script on jumphost so that i can start working on it from jumphost itself .
Thanks Corona688 again and hicksd8 too.
When Corona688 says that the 'reboot' command is not interactive I think he means that it doesn't ask for confirmation. If you are root then that command (on most Unix flavors) will reboot the system (instantly) so prone to mistakes.
The 'shutdown' command is the standard way of doing it because you can specify a delay, send a warning to all logged-in users that the system is going down, etc. During the warning period the sequence could be interrupted if it was issued in error.
Another command you should be aware of is 'init' which changes the 'run level'.
will close down the system
will reboot the system
will close down the system and power it off if your PSU supports it.
There are other 'run levels'; see the man page.
Most of the above relates to generic Unix speak. Depending on which flavour you're running, in my experience, 'init <run level>' is more likely to give you an orderly shutdown/reboot than the 'reboot' command.
'init' is the sysadmins short cut and NOT to be used by anyone else.
Hello my dear friends,
Two file are auto generated from mon - fri at different directories on same windows box.Every day i have to copy the file, rename it (specific name)and ftp it to linux box specified directory.
is it possible to automate this process,If yes this has to be done from windows... (1 Reply)
Hi,
I need to add confirmation pop up msg box before deleting the record from database, I have added following snippets to my code but its not working for me, your help will be much appreciated :
print header;
print <<EOF;
<script type="text/javascript">
function confirmOk() {
return... (0 Replies)
Hi
I have a linux box and need to access from windows graphically
# uname -a
Linux pc-l416116 2.6.18-155.el5 #1 SMP Fri Jun 19 17:06:47 EDT 2009 i686 i686 i386 GNU/Linux
What components do I need to install on Linux and windows to do that?
TIA (6 Replies)
Hi,
I've been able to mount my linux box to a windows machine, but I can't seem to mount my linux box to another linux box I have. (I know I could scp, but for other reasons I need to do it this way) Samba is installed.
Here is an example where I mount to a Win machine.--> works fine
mount... (12 Replies)
hi guys!
I like to know which user has rebooted or shutdown a redhat box ?
the thing is wanted to know the exact user name who has done this action, ofcourse an admin privileged user only can do this. from a list of admin privileged user to find the exact one.
i used to go with last... (4 Replies)
Below is my script that is using to rename the name of file .Here I am using two methods to pass the both arguments wih script name or run the script and give the input one by one.But my issue is I want to rename the name of the file if user select Y(y) then it should rename the file else select... (4 Replies)
there are 'sync' and 'shutdown' users in my /etc/passwd.
...
sync:x:5:0:sync:/sbin:/bin/sync
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
...
What does these mean? (10 Replies)
Hi,
I need to provide execute access to certain users and not to all users
For ex: if ther is a file /home/august/aug.sh.
and there are user's like jan,feb,mar,april,May and jan is the owner of that box. I need to provide execute access to feb and mar only. I also know the root pwd for... (3 Replies)
Hi,
I was writing a simple web application using Perl -CGI. When users try to do some operations, I wanted like a pop-up confirmation box. Is this possible with Perl-CGI?
Thanks in advance.
Regards,
garric (6 Replies)
HI All,
I need a script to reboot a linux box from a windows box.
The script needs to run automatically whenever a sitescope alerts with an error message.
Have searched for this in the forums, but could not get something relative.
Pls. let me know the various alternatives we have to do... (2 Replies)