#! /bin/sh ### BEGIN INIT INFO # Provides: network-manager # Required-Start: $remote_fs dbus udev # Required-Stop: $remote_fs dbus udev # Should-Start: $syslog # Should-Stop: $syslog # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: network connection manager # Description: Daemon for automatically switching network # connections to the best available connection. ### END INIT INFO setglobal PATH = '/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin' setglobal DESC = '"network connection manager'" setglobal NAME = '"NetworkManager'" setglobal DAEMON = "/usr/sbin/$NAME" setglobal PIDFILE = "/var/run/$NAME/$NAME.pid" setglobal SCRIPTNAME = '/etc/init.d/network-manager' # Gracefully exit if the package has been removed. test -x $DAEMON || exit 0 source /lib/lsb/init-functions test -f /etc/default/NetworkManager && source /etc/default/NetworkManager # # Function that starts the daemon/service. # proc d_start { start-stop-daemon --start --quiet --pidfile $PIDFILE \ --exec $DAEMON -- $DAEMON_OPTS } # # Function that stops the daemon/service. # proc d_stop { start-stop-daemon --stop --retry 5 --quiet --pidfile $PIDFILE \ --exec $DAEMON } match $1 { with start log_daemon_msg "Starting $DESC" $NAME d_start match "$Status" { with 0 log_end_msg 0 with 1 log_progress_msg "already started" log_end_msg 0 with * log_end_msg 1 } with stop log_daemon_msg "Stopping $DESC" $NAME d_stop match "$Status" { with 0 log_end_msg 0 with 1 log_progress_msg "already stopped" log_end_msg 0 with * log_end_msg 1 } with restart|force-reload $0 stop $0 start with status status_of_proc -p $PIDFILE $DAEMON $NAME && exit 0 || exit $? with * echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload|status}" > !2 exit 1 } exit 0