- if [ -d $CONFIG_DIR/$NAME/conf.d ] ; then
- test -d $VARCONFIG_DIR || mkdir -p $VARCONFIG_DIR
- chmod 700 $VARCONFIG_DIR
- rm -f $VARCONFIG_DIR/$NAME 2>/dev/null
- for CLIENTNAME in `ls $CONFIG_DIR/$NAME/conf.d`; do
- echo -n " ($CLIENTNAME)"
- DAEMONARG=`sed 's/#.*//' < $CONFIG_DIR/$NAME/conf.d/$CLIENTNAME | grep -e '\w' | sed 's/^/ --/' | xargs echo`
- $ANYTUNCONFIG $DAEMONARG >> $VARCONFIG_DIR/$NAME
- done
- CONTROLHOST=`sed 's/#.*//' < $CONFIG_DIR/$NAME/config | grep -e 'control-host' | sed 's/^/ --/'`
- $CONTROLDAEMON -f $VARCONFIG_DIR/$NAME $DAEMONOPTS $CONTROLHOST \
- --write-pid $VARCONFIG_DIR/$NAME.pid
- # rm -f $VARCONFIG_DIR/$NAME
- fi