X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=systemd%2Fplc-ctl;fp=plc.init;h=415be31c216e9961178e841cc3335fdc44f1eeaf;hb=e0fa32ac08e2d8434943a230da7a4740d55d3a85;hp=14881947082c0093744fb8980d3aa86a3e53f006;hpb=320a71c520ea26936264d9935b6b05e25a0de9bc;p=myplc.git diff --git a/plc.init b/systemd/plc-ctl similarity index 96% rename from plc.init rename to systemd/plc-ctl index 1488194..415be31 100755 --- a/plc.init +++ b/systemd/plc-ctl @@ -9,7 +9,7 @@ # Source function library and configuration # plc_reload is defined here -. /etc/plc.d/functions +source /etc/plc.d/functions # Verbosity verbose=0 @@ -46,8 +46,7 @@ done | sort -n | cut -d' ' -f2 )) nsteps=${#steps[@]} -usage() -{ +function usage() { echo "Usage: $0 [OPTION]... [COMMAND] [STEP]..." echo " -v Be verbose" echo " -h This message" @@ -86,8 +85,8 @@ done if [ $verbose -eq 0 ] ; then touch /var/log/boot.log chmod 600 /var/log/boot.log - exec 1>>/var/log/boot.log - exec 2>>/var/log/boot.log + exec 1>> /var/log/boot.log + exec 2>> /var/log/boot.log fi # Get command @@ -110,8 +109,7 @@ fi RETVAL=0 -start () -{ +function start () { for step in "${steps[@]}" ; do if [ -x /etc/plc.d/$step ] ; then /etc/plc.d/$step start @@ -124,8 +122,7 @@ start () done } -stop () -{ +function stop () { for i in $(seq 1 $nsteps) ; do step=${steps[$(($nsteps - $i))]} if [ -x /etc/plc.d/$step ] ; then @@ -158,7 +155,7 @@ case "$command" in if [ -z "$cpfile" ] ; then echo "PLC: checkpoint requires a filename as an argument" exit 1 - fi + fi cpdir=$(mktemp -d tmp.XXXXXX) cd $cpdir mkdir -p ./etc/planetlab/