summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJim Pryor <profjim@jimpryor.net>2009-08-11 14:04:52 +0200
committerJames Rayner <james@archlinux.org>2009-08-15 04:28:26 +0200
commitc0b4b19486aaa6e277c3344c40419225e085bd69 (patch)
tree22af58137e0ade6080f880340f853cb251f1fd57 /src
parente4271e46d3ddfe0a3dbaef66d51157bfd88ca2ff (diff)
downloadnetctl-c0b4b19486aaa6e277c3344c40419225e085bd69.tar.gz
netctl-c0b4b19486aaa6e277c3344c40419225e085bd69.tar.xz
Everyone use i/o functions from globals/hooks
Signed-off-by: Jim Pryor <profjim@jimpryor.net>
Diffstat (limited to 'src')
-rw-r--r--src/globals5
-rw-r--r--src/net-profiles8
-rw-r--r--src/net-rename9
-rw-r--r--src/netcfg1
-rw-r--r--src/netcfg-menu7
-rw-r--r--src/network1
6 files changed, 10 insertions, 21 deletions
diff --git a/src/globals b/src/globals
index 4e2c397..318c9d9 100644
--- a/src/globals
+++ b/src/globals
@@ -1,8 +1,3 @@
-##################################
-##
-# /usr/lib/network/globals
-##
-##################################
# /etc/network.d/hooks directory
#
diff --git a/src/net-profiles b/src/net-profiles
index 67ab5e8..6c001ea 100644
--- a/src/net-profiles
+++ b/src/net-profiles
@@ -1,13 +1,11 @@
#!/bin/bash
-. /etc/rc.conf
-. /etc/rc.d/functions
+. /usr/lib/network/globals
case "$1" in
start)
if ! ck_daemon net-profiles; then
- echo "net-profiles has already been started. Try '/etc/rc.d/net-profiles restart'"
- exit
+ exit_stderr "net-profiles has already been started. Try '/etc/rc.d/net-profiles restart'"
fi
# Ensure any device renaming has occurred as intended
@@ -53,7 +51,7 @@ case "$1" in
$0 stop; sleep 1; $0 start
;;
*)
- echo "usage: $0 {start|stop|restart}"
+ exit_stderr "Usage: $0 {start|stop|restart}"
esac
# vim: set ts=4 et sw=4:
diff --git a/src/net-rename b/src/net-rename
index db2c461..25a38ed 100644
--- a/src/net-rename
+++ b/src/net-rename
@@ -1,13 +1,12 @@
#!/bin/bash
-. /etc/rc.conf
-. /etc/rc.d/functions
+. /usr/lib/network/globals
case "$1" in
start)
- stat_busy "Renaming network devices"
+ report_try "Renaming network devices"
ifrename -p -t
- stat_done
+ report_success
add_daemon net-rename
;;
@@ -20,6 +19,6 @@ case "$1" in
$0 start
;;
*)
- echo "usage: $0 {start|stop|restart}"
+ exit_stderr "Usage: $0 {start|stop|restart}"
esac
# vim: set ts=4 et sw=4:
diff --git a/src/netcfg b/src/netcfg
index 50d9bcf..57d7a74 100644
--- a/src/netcfg
+++ b/src/netcfg
@@ -1,6 +1,5 @@
#!/bin/bash
-. /etc/rc.conf
. /usr/lib/network/network
NETCFG_VER=2.2.1
diff --git a/src/netcfg-menu b/src/netcfg-menu
index 8c58edc..3c800a1 100644
--- a/src/netcfg-menu
+++ b/src/netcfg-menu
@@ -1,7 +1,5 @@
#! /bin/bash
-. /etc/rc.conf
-. /etc/rc.d/functions
. /usr/lib/network/network
@@ -19,8 +17,7 @@ for prof in `find -L $PROFILE_DIR -maxdepth 1 -type f -printf "%f\n"|sort`; do
done
if [ ${#profiles} -eq 0 ]; then
- echo "No profiles were found in $PROFILE_DIR"
- return 1
+ exit_err "No profiles were found in $PROFILE_DIR"
fi
# if no default yet, use the first entry
@@ -52,7 +49,7 @@ case $ret in
netcfg2 $(cat $ANSWER)
;;
*) # Shouldnt happen
- echo "Abnormal ret code from dialog: $ret"
+ exit_err "Abnormal ret code from dialog: $ret"
;;
esac
rm $ANSWER
diff --git a/src/network b/src/network
index 20ca28e..e7e262a 100644
--- a/src/network
+++ b/src/network
@@ -1,5 +1,6 @@
### Globals
. /usr/lib/network/globals
+# will load hooks and they in turn will load /etc/rc.d/functions if they need to
### Profile loading
##