I want an option at runlevel 3 ( Console-only login .. no GUI login ) to choose halt or reboot the PC. This is useful in case
create a script named "options" in /etc/rc.d Here are the contents :
#!/bin/sh clear RUNLEVEL=`runlevel | cut -f2 -d " "` if [ "$RUNLEVEL" -eq 3 ] then echo "Select :" echo "[1] Login" echo "[2] Shutdown" echo "[3] Reboot" read -p "Do : " option case $option in 2) halt;; 3) reboot;; *) clear;; esac else clear fi
make the script executable with chmod add an entry in /etc/rc.local sh /etc/rc.d/options
Now whenever ur computer boots for into runlevel 3 then it executes this script or else it skips it.
__________________________________ Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree
On Tue, 11 Nov 2003, Hitesh Lad wrote:
create a script named "options" in /etc/rc.d Here are the contents :
Thanks for the idea. The only drawback seems to be that the user has to interactively select the option each time the PC boots. This is inconvenient if my default runlevel is 3 ; of course we could have a timeout period. Again if that timeout period expires we are at login prompt. Now if the user wants the option to halt or reboot, we have a problem.