lfs-execline-scripts

Repository for execline scripts used in my linux-from-scratch builds
Log | Files | Refs

network (758B)


      1 #!/usr/bin/execlineb -S1
      2 # Use execlineb -WS1 for debug/testing (errors out on bad syntax)
      3 
      4 # set PID to pid of running process (may (not) exist)
      5 #backtick PID { pidof -o %PPID $bins }
      6 envfile /etc/svc.d/default/network.conf
      7 
      8 case -N -- $1
      9 {
     10 	"-s" { # start case:
     11 		# iproute2/busybox (ewww!)
     12 		ip addr add 127.0.0.1/8 dev lo broadcast + scope host
     13 		ip link set lo up
     14 
     15 		# ifconfig (net-tools) (yay!)
     16 		#ifconfig lo up 127.0.0.1/8
     17 		#ifconfig $DEV1 mtu $DEV1_MTU
     18 		#route add default gw $GW_ADDY $DEV1
     19 	}
     20 	"-k" { # kill case:
     21 		# iproute2/busybox (ewww!)
     22 		ip link set lo down
     23 		ip link set $DEV1 down
     24 
     25 		# ifconfig (net-tools) (yay!)
     26 		#ifconfig lo down
     27 		#ifconfig $DEV1 down
     28 	}
     29 } # default case:
     30 foreground { /bin/printf "usage: %s -s|-k\n" "$0" } exit 1