conn

A script repository to manage connections in Linux.
git clone git://r-36.net/conn
Log | Files | Refs | README | LICENSE

run.sh (459B)


      1 #!/bin/sh
      2 
      3 . ../common.sh
      4 
      5 interface=$2
      6 [ -z "$2" ] && interface="eth0"
      7 
      8 case "$1" in
      9 	-s)
     10 		if ! islinkup $interface;
     11 		then
     12 			setlinkup $interface
     13 		fi
     14 		startdhcp $interface
     15 		exit $?
     16 		;;
     17 	-k)
     18 		stopdhcp $interface
     19 		islinkup $interface && setlinkdown $interface
     20 		exit $?
     21 		;;
     22 	-o)
     23 		exit isdhcprunning $interface
     24 		;;
     25 	-u)
     26 		;;
     27 	-r)
     28 		$0 -k $interface;
     29 		$0 -s $interface;
     30 		;;
     31 	*)
     32 		echo "usage: $0 [-s|-k|-u|-r] interface"
     33 		exit 1
     34 		;;
     35 esac
     36 exit 0
     37