Created
October 27, 2014 03:53
-
-
Save mengzhuo/8284208b0a6e123c63cb to your computer and use it in GitHub Desktop.
简易Debian中文管理别名
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
# 新手专用 :) | |
countdown() | |
( | |
IFS=: | |
set -- $* | |
secs=$(( ${1#0} )) | |
while [ $secs -gt 0 ] | |
do | |
sleep 1 & | |
printf "\r倒计时 %02d:%02d" $(( (secs/60)%60)) $((secs%60)) | |
secs=$(( $secs - 1 )) | |
wait | |
done | |
echo | |
) | |
alias_service() | |
{ | |
service $2 $1 | |
} | |
alias 更新='apt-get update && apt-get upgrade' | |
alias 状态='echo "+ 运行中/ - 已停止 / ? 不明" && service --status-all' | |
alias 系统关机='echo "即将关机!!!!!!!" && countdown 5 && shutdown -h now' | |
alias 系统重启='echo "即将重启!!!!!!!" && countdown 5 && reboot' | |
alias 杀光='killall' | |
alias 停掉='countdown 5 && alias_service stop' | |
alias 启动='alias_service start' | |
alias 重载='countdown 5 && alias_serivce restart' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment