Example shell script with embedded POD documentation
- -v, --verbose
- --debug
- -h, --help Print this help
+ -v, --verbose Print verbose mode
+ -d, --debug Print debug messages
+ -h, --help Print this help (alternatives: --man, --help-html|-hh)
=head1 DESCRIPTION
-*help|-h) usage | pod2text --width 250; exit 0 ;;
--man) usage | pod2man | man -l -; exit 0 ;;
+ --help-html|-hh) usage | pod2html; exit 0 ;;
--verbose|-v) VERBOSE=$(($VERBOSE+1)) ;;
- --debug) DEBUG=$(($DEBUG+1)) ;;
+ --debug|-d) DEBUG=$(($DEBUG+1)) ;;
*) echo "Unknow option: $1 at $0!"; exit -1; ;;
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin
DAEMON=/usr/sbin/YOUR
-OPTS=""
+ARGS=""
NAME=`basename $DAEMON`
PIDFILE="/var/run/$NAME.pid"
log_daemon_msg "Starting" "${NAME}"
start-stop-daemon --start --background --quiet \
--pidfile $PIDFILE --make-pidfile \
- --exec $DAEMON -- $OPTS
+ --exec $DAEMON -- $ARGS
log_end_msg $?
;;
stop)