1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#!/bin/bash SERVICE_DIR=/service SCRIPT_DIR=/etc/sv if [ -d $SCRIPT_DIR/$1 ] then if [ -d $SERVICE_DIR/$1 ] then echo "$1 is already present" else ln -s $SCRIPT_DIR/$1 $SERVICE_DIR/$1 echo "adding $1" fi else echo "couldn't find $SCRIPT_DIR/$1" fi