aboutsummaryrefslogtreecommitdiff
path: root/netcfg
diff options
context:
space:
mode:
authorJudd Vinet <judd@archlinux.org>2005-09-15 20:05:07 +0000
committerJudd Vinet <judd@archlinux.org>2005-09-15 20:05:07 +0000
commite772aeae76f2ad704a834dc17df02dbc137a6573 (patch)
tree954dcf245b4eedb69badab02e5b22459364c5cb2 /netcfg
parent0be8f5b2d33fc6160e2a62d33fc1f828218fa90a (diff)
downloadinitscripts-e772aeae76f2ad704a834dc17df02dbc137a6573.tar.xz
modified netcfg/network scripts -- you can list multiple entries in NET_PROFILES that use the same INTERFACE. They will be started one at a time, and the first successful one will be kept.
Diffstat (limited to 'netcfg')
-rwxr-xr-xnetcfg9
1 files changed, 8 insertions, 1 deletions
diff --git a/netcfg b/netcfg
index 70dd342..4de5052 100755
--- a/netcfg
+++ b/netcfg
@@ -19,11 +19,14 @@ usage()
{
version
echo
- echo "usage: netcfg <profile_name>"
+ echo "usage: netcfg [options] <profile_name>"
echo " netcfg --stop <interface>"
echo " netcfg --menu [--timeout <secs>]"
echo " netcfg --stopall"
echo
+ echo "options:"
+ echo " -c Don't reconfigure an interface if it's already up"
+ echo
echo "Network profiles are stored in $PROFILE_DIR"
echo
}
@@ -77,6 +80,8 @@ start_profile()
# Read the profile
. $PROFILE_DIR/$1
+ [ "$CHECK" = "1" -a -f $STATE_DIR/$INTERFACE ] && return
+
# Shut down any profiles tied to this interface
stop_profile $INTERFACE
@@ -208,6 +213,7 @@ fi
# Parse command line
MODE="profile"
+CHECK=0
PROFILE=
IFACE=
TIMEOUT=
@@ -223,6 +229,7 @@ while [ $# -ne 0 ]; do
--timeout) shift
TIMEOUT=$1 ;;
--*) MODE="usage" ;;
+ -c) CHECK=1 ;;
-*) MODE="usage" ;;
*) PROFILE=$1 ;;
esac