summaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/11netcfg47
-rwxr-xr-xcontrib/common.hook91
2 files changed, 0 insertions, 138 deletions
diff --git a/contrib/11netcfg b/contrib/11netcfg
deleted file mode 100755
index db65f5a..0000000
--- a/contrib/11netcfg
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/bin/bash
-
-source /usr/lib/pm-utils/functions
-source /etc/pm/config.d/netcfg
-
-suspend_netcfg() {
- case $NETCFG_SUSPEND in
- daemons)
- stopservice net-profiles
- stopservice net-auto-wired
- stopservice net-auto-wireless
- ;;
- retain|*)
- netcfg all-suspend
- ;;
- esac
-}
-
-resume_netcfg() {
- case $NETCFG_SUSPEND in
- daemons)
- restartservice net-profiles
- restartservice net-auto-wired
- restartservice net-auto-wireless
- ;;
- retain|*)
- netcfg all-resume
- ;;
- esac
-}
-
-if [ -x /usr/bin/netcfg2 ]; then
- case "$1" in
- hibernate|suspend)
- suspend_netcfg
- ;;
- thaw|resume)
- resume_netcfg
- ;;
- *)
- ;;
- esac
-fi
-
-exit $?
-
-# vim: ft=sh ts=4 et sw=4:
diff --git a/contrib/common.hook b/contrib/common.hook
deleted file mode 100755
index 9018888..0000000
--- a/contrib/common.hook
+++ /dev/null
@@ -1,91 +0,0 @@
-### Sample netcfg hook script showing how to declare shared settings
-#
-### These functions and variables will be available to all profiles
-### (They can be manually overridden by any profile.)
-### To install, make this executable and put it in /etc/network.d/hooks
-
-function RUNDAEMON {
- # "RUNDAEMON [options] daemon { start | stop }" will run the daemon
- # -d DEP: will only run if daemon DEP is registered as also started/stopped in /var/run/daemons
- # will only stop if daemon is running (or option -f)
- # will only start if daemon is in the DAEMONS array (or option -f)
- local force dep
- while true; do
- if [[ "$1" = "-f" ]]; then
- force=1
- shift
- elif [[ "$1" = "-d" ]]; then
- [[ -e "/run/daemons/$2" ]]
- if [ $? -eq 0 ]; then
- case "$dep" in
- yes) ;;
- no) dep=mixed;;
- *) dep=yes;;
- esac
- else
- case "$dep" in
- no) ;;
- yes) dep=mixed;;
- *) dep=no;;
- esac
- fi
- shift 2
- else
- break
- fi
- done
- local daemon="$1"
- shift
- if [[ ! -x "/etc/rc.d/$daemon" ]]; then
- echo "/etc/rc.d/$daemon isn't executable." >&2
- return 1
- fi
- case "$1" in
- start)
- if [[ "$dep" = no || "$dep" = mixed ]]; then
- force=0
- elif [[ "$force" -ne 1 ]]; then
- for f in "${DAEMONS[@]}"; do
- if [[ "$f" = "$daemon" || "$f" = "@$daemon" ]]; then
- force=1
- break
- fi
- done
- fi
- ;;
- stop)
- if [[ "$dep" = yes || "$dep" = mixed ]]; then
- force=0
- elif [[ "$force" -ne 1 ]]; then
- [[ ! -e "/var/run/$daemon" ]]
- force=$?
- fi
- ;;
- *)
- force=1
- ;;
- esac
- if [[ "$force" -eq 1 ]]; then
- "/etc/rc.d/$daemon" "$@"
- local result=$?
- stat_busy "Resuming netcfg $PROFILE..." # else we'll get a [DONE] or [FAIL] at the end of a third blank line, after messages from $daemon
- return $result
- fi
- return 0 # $daemon doesn't satisfy conditions, fail quietly
- # returning 1 would make our POST_UP script, and hence our connection attempt, fail
-}
-
-# Example of some things you might do in your POST_UP/PRE_DOWN scripts
-# (In fact, I couldn't get awesome-client to work on its own in this context, I had to call a wrapper instead that
-# sources the file in ~/.dbus/session-bus and then exports DBUS_SESSION_BUS_ADDRESS, and then calls awesome-client.)
-#
-PRE_DOWN='RUNDAEMON -f netfs stop'
-POST_DOWN='( sleep 3 && echo "mynetworkfun()" | sudo -Hu me /usr/bin/awesome-client 2>/dev/null) &'
-
-POST_UP='( sleep 3 && echo "mynetworkfun()" | sudo -Hu me /usr/bin/awesome-client 2>/dev/null) & RUNDAEMON -f -d nfs-common netfs start'
-
-# Quirks and other variables defined here will apply to all your profiles...
-QUIRKS=()
-WPA_GROUP="network"
-
-# vim: ft=sh ts=4 et sw=4: