Logo Search packages:      
Sourcecode: ultrapossum version File versions  Download package

policy-rc.d

#!/bin/sh
#
# Copyright (c) 2004 Masato Taruishi <taru@debian.org>
#
#

set -e

OVERALL_POLICY=104

usage() {
  cat 1>&2 <<EOF
Usage:
  $0 [options] <initscript ID> <actions> [<runlevel>]
  $0 [options] --list <initscript ID> [<runlevel> ...]
EOF
}

showarg() {
  echo "mode: $mode"
  echo "id: $id"
  echo "action: $actions"
  echo "runlevel: $runlevel"
}

quiet=0
mode=policy

state=start
while test $# -gt 0 && test "x$state" != "xend"; do
  case "$1" in
  --quiet)
    quiet=1
    ;;
  --list)
    mode=list
    ;;
  *)
    case "$mode" in
      policy)
        echo $@
        if test "x$2" = "x"; then
        usage
        exit 103
      fi
        id=$1
      actions="$2"
      runlevel="$3"
      state=end
        ;;
      list)
        id=$1
      if test "x$2" != "x"; then
        shift
        runlevel="$@"
      fi
      state=end
        ;;
    esac
    ;;
  esac
  shift
done

if test "x$id" = "x"; then
  usage
  exit 103
fi

# showarg 1>&2

case "$mode" in
  policy)
    POLICYRC=$OVERALL_POLICY
    if test -f "/etc/ultrapossum/debian.cf"; then
      . /etc/ultrapossum/debian.cf
    fi
    exit $POLICYRC
    ;;
  list)
    echo "ultrapossum-server <start|stop|restart|force-reload>"
    ;;
esac

exit 102


Generated by  Doxygen 1.6.0   Back to index