攔截用戶輸入的 reboot 命令,防止手滑輸入成reboot導致服務器重啟
把下面代碼寫入到 /etc/profile 內,并執行一次 source /etc/profile
# 自定義一個 func
sendya_reboot() { while true do echo -n "You really want to restart the server? (yes/no):" read crm if [ "$crm"x = "yes"x ]; then echo "rebooting" reboot else break fi break done } # 別名 alias reboot='sendya_reboot'