case编写的httpd简单启停脚本
case编写的httpd简单启停脚本
#!/bin/bash HTTPD="/etc/init.d/httpd" . /etc/init.d/functions case "$1" in start) $HTTPD start >& /dev/null [ $? -eq 0 ] && action "httpd is startd" /bin/true ||\ action "httpd is startd"/bin/false ;; stop) $HTTPD stop >& /dev/null [ $? -eq 0 ] && action "httpd is stopd" /bin/true ||\ action "httpd is stopd"/bin/false ;; restart) $HTTPD restart >& /dev/null [ $? -eq 0 ] && action "httpd is restartd" /bin/true ||\ action "httpd is restartd"/bin/false ;; *) echo "$0 Usage {start stop restart}" esac