以 apache/httpd 服务作为例子 任务 Red Hat / Fedora Ubuntu Ubuntu (with sysv-rc-conf or sysvconfig) 立即启动/停止某服务 service httpd start invoke-rc.d apache start service apache start 启动时自动加载 chkconfig httpd on update-rc.d apache defaults sysv-rc-conf apache on 启动时不加…
#!/bin/bash set -e -u show_help() { echo "This help message is useless, please read the content of /bin/pacman" exit 1 } if [ $# = 0 ]; then show_help; fi CMD="$1" shift 1 case "$CMD" in -h) show_help;; -Sy) apt-get update;;…