diff options
author | Omar Vega Ramos <ovruni@gnu.org.pe> | 2015-08-28 18:46:37 -0500 |
---|---|---|
committer | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2015-09-22 16:14:58 -0300 |
commit | 3a78329cae798b7dcd989fee622b016b7fb4d437 (patch) | |
tree | 5454eaed9ad5a22b5059995719a844a41a1967cb /pcr/networkmanager-consolekit/networkmanager.rc | |
parent | 1077a9ac2f9b32c6f28f9e6e6188b0f4c8dd926d (diff) | |
download | abslibre-3a78329cae798b7dcd989fee622b016b7fb4d437.tar.gz abslibre-3a78329cae798b7dcd989fee622b016b7fb4d437.tar.bz2 abslibre-3a78329cae798b7dcd989fee622b016b7fb4d437.zip |
networkmanager-consolekit-1.0.6-1: updating version
Diffstat (limited to 'pcr/networkmanager-consolekit/networkmanager.rc')
-rw-r--r-- | pcr/networkmanager-consolekit/networkmanager.rc | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/pcr/networkmanager-consolekit/networkmanager.rc b/pcr/networkmanager-consolekit/networkmanager.rc new file mode 100644 index 000000000..1e803e87b --- /dev/null +++ b/pcr/networkmanager-consolekit/networkmanager.rc @@ -0,0 +1,60 @@ +#!/bin/bash + +NETWORKMANAGER_BIN=/usr/bin/NetworkManager + +# general config +. /etc/rc.conf +. /etc/rc.d/functions + +PID=`pidof -o %PPID $NETWORKMANAGER_BIN` +case "$1" in + start) + ck_daemon dbus && /etc/rc.d/dbus start + + stat_busy "Starting NetworkManager" + [ ! -d /var/run/NetworkManager ] && install -d /var/run/NetworkManager + if [ -z "$PID" ]; then + $NETWORKMANAGER_BIN + fi + if [ ! -z "$PID" -o $? -gt 0 ]; then + stat_fail + else + add_daemon networkmanager + stat_done + fi + ;; + stop) + stat_busy "Stopping NetworkManager" + [ ! -z "$PID" ] && kill $PID &> /dev/null + if [ $? -gt 0 ]; then + stat_fail + else + rm_daemon networkmanager + stat_done + fi + ;; + restart) + $0 stop + sleep 1 + $0 start + ;; + sleep) + /usr/bin/dbus-send --system \ + --dest=org.freedesktop.NetworkManager \ + --type=method_call \ + /org/freedesktop/NetworkManager \ + org.freedesktop.NetworkManager.sleep + ;; + wake) + /usr/bin/dbus-send --system \ + --dest=org.freedesktop.NetworkManager \ + --type=method_call \ + /org/freedesktop/NetworkManager \ + org.freedesktop.NetworkManager.wake + ;; + *) + echo "usage: $0 {start|stop|restart|sleep|wake}" + ;; +esac +exit 0 + |