From c0b4b19486aaa6e277c3344c40419225e085bd69 Mon Sep 17 00:00:00 2001 From: Jim Pryor Date: Tue, 11 Aug 2009 08:04:52 -0400 Subject: Everyone use i/o functions from globals/hooks Signed-off-by: Jim Pryor --- src/globals | 5 ----- src/net-profiles | 8 +++----- src/net-rename | 9 ++++----- src/netcfg | 1 - src/netcfg-menu | 7 ++----- src/network | 1 + 6 files changed, 10 insertions(+), 21 deletions(-) (limited to 'src') 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 ## -- cgit v1.2.3-24-g4f1b