#!/bin/bash
# Program
# 关机脚本
# History:
# 12/16/2010 saint first release
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
##########
echo "**************************"
echo "**这是一个关机操作的程序**"
echo "****选择你要进行的操作****"
echo "*1 关机重启 2 直接关机*"
echo "*3 定时关机 4 退出 *"
echo "**************************"
read -p "请输入选项:" se
clear
read -p "你确定了你的选择(Y/N)?" yn1
case $yn1 in
"N")
clear
exit 1 ;;
"Y")
clear
case $se in
"1")
testing=`shutdown -r now` ;;
"2")
testing=`shutdown -h now` ;;
"3")
read -p "你想多少秒后关机:" mm
testing=`shutdown -h -t $mm` ;;
"4")
CClear=`clear`
read -p "你确定放弃此操作(Y/N):" yn
clear
if [ "$yn" == "Y" ] ; then
exit 0
elif [ "$yn" == "N" ] ; then
exit 1
fi
;;
esac ;;
esac
阅读(577) | 评论(0) | 转发(0) |