forked from gregorgorjanc/GorjancShell
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c1cb6e5
commit 2c941e9
Showing
1 changed file
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
|
||
# STOP | ||
#------------------------------------------------------------------------------- | ||
|
||
# Shutdown the machine with simple command. Needs user confirmation and | ||
# user privilege to shutdown command via 'sudo'. | ||
|
||
# Usage: stop | ||
|
||
# My-time-stamp: <2003-11-16 08:56:00 ggorjan> | ||
|
||
stop() | ||
{ | ||
local NAME YORN | ||
NAME=stop | ||
echo -e 'Are you sure to shutdown the machine (y/N)? \c' | ||
read YORN | ||
if [ $YORN == y ]; then | ||
if [ -f ${HOME}/.onStop.sh ]; then | ||
source ${HOME}/.onStop.sh | ||
fi | ||
echo | ||
echo 'Gooing to sleep .... bz ... :)' | ||
echo | ||
sudo shutdown -h now | ||
else | ||
echo 'OK, some other time.' | ||
fi | ||
} | ||
export -f stop | ||
|
||
# REBOOT | ||
#------------------------------------------------------------------------------- | ||
|
||
# Reboot the machine with simple command via 'sudo'. Needs user | ||
# confirmation. | ||
|
||
# Usage: reboot | ||
|
||
# My-time-stamp: <2003-11-16 08:56:00 ggorjan> | ||
|
||
reboot() | ||
{ | ||
local NAME YORN | ||
NAME=reboot | ||
echo -e 'Are you sure to reboot the machine (y/N)? \c' | ||
read YORN | ||
if [ $YORN == y ]; then | ||
echo | ||
echo 'Rebooting ...' | ||
echo | ||
sudo /sbin/reboot | ||
else | ||
echo 'OK, some other time.' | ||
fi | ||
} | ||
export -f reboot |