#!/bin/bash # =================================================== # # llxcfg-httpd # # # # Junio 2007. Modificado para usar cpkg # # =================================================== # # set -e usage(){ CMD="$(basename "$0")" exit_message \ "Usage: $CMD {start|stop|restart|reload|allow|deny|info|listfiles|update|revert|cpkgs}" } exit_message() { echo -e "$1" >&2 exit 1 } ############# # variables # ############# CPKGS="http" # test [ "${LLX_WWW_PATH}" ] || exit 1 ######## # main # ######## ACTION="$1" case "$ACTION" in start|stop|restart|reload) SERVICES="$(llxcfg-cpkg grepinfo Services ${CPKGS})" for s in ${SERVICES}; do if [ -x "/etc/init.d/${s}" ] ; then invoke-rc.d "${s}" "$ACTION" || true fi done ;; cpkgs) for c in $CPKGS ; do echo $c done ;; allow|deny|listfiles|update|revert|info) llxcfg-cpkg "$ACTION" $CPKGS || true ;; *) usage ;; esac exit 0