#!/bin/bash # Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 source /sbin/functions.sh esyslog() { :; } argv0=${0##*/} usage() { cat << FOO usage: ${argv0} -a|add script runlevel1 [runlevel2 ...] ${argv0} -d|del script [runlevel1 ...] ${argv0} -s|show [-v|--verbose] [runlevel1 ...] examples: # ${argv0} add net.eth0 default Adds the net.eth0 script (in /etc/init.d) to the "default" runlevel. # ${argv0} del sysklogd Deletes the sysklogd script from all runlevels. The original script is not deleted, just any symlinks to the script in /etc/runlevels/*. # ${argv0} del net.eth2 default wumpus Delete the net.eth2 script from the default and wumpus runlevels. All other runlevels are unaffected. Again, the net.eth2 script residing in /etc/init.d is not deleted, just any symlinks in /etc/runlevels/default and /etc/runlevels/wumpus. # ${argv0} show Show all enabled scripts and list at which runlevels they will execute. Run with --verbose to see all available scripts. FOO exit ${1:-0} } add() { local ret=0 local x= local myscript= if [[ $# -lt 2 ]] ; then eerror "Usage: ${argv0} add