lfs-execline-scripts

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

dropbear (658B)


      1 #!/usr/bin/execlineb -S1
      2 # Use execlineb -WS1 for debug/testing (errors out on bad syntax)
      3 importas -S PATH
      4 
      5 envfile /etc/svc.d/default/dropbear.conf
      6 
      7 case -N -- $1
      8 {
      9 	"-s" { # start case
     10 		foreground { printf "Starting dropbear daemon...\n" }
     11 		background { dropbear $DB_OPTS -P /run/dropbear.pid }
     12 	}
     13 	"-k" { # kill case
     14 		# set PID to pid of running process (may (not) exist)
     15 		#backtick PID { pidof -o %PPID dropbear }
     16 		backtick PID { cat /run/dropbear.pid }
     17 		foreground { printf "Stopping dropbear daemon...\n" }
     18 		forx x { $PID }
     19 		{
     20 			foreground { kill -9 $x }
     21 		}
     22 	}
     23 } # default case:
     24 foreground { /usr/bin/printf "usage: %s -s|-k\n" "$0" } exit 1