Aido.git / aido-server.in

version» Context lines:

Aido.git/aido-server.in:14:   LOG='@DIR@/logs/server-debug'      while [ ! c"$1" = "c" ] ; do    case "$1" in    -D*|-d*|-t*)    DEFINES="$DEFINES $1"    ;;    '--once')    once=1    ;; +  '--kill'|'--stop') +  if [ -f $HOME/.aido/pid ]; then +  PID=`cat $HOME/.aido/pid` +  kill $PID 2>/dev/null && wait $PID 2>/dev/null +  fi +  exit 0 +  ;; +  '--restart') +  if [ -f $HOME/.aido/pid ]; then +  PID=`cat $HOME/.aido/pid` +  kill -HUP $PID 2>/dev/null +  fi +  exit 0 +  ;;    '--nossl'|'--no-sll')    DEFINES="-DNOSSL $DEFINES"    ;;    '--debug'|'--with-debug'|'--enable-debug')    DEBUG=1    DEFINES="-DVP_DEBUG $DEFINES"    ;;    '--version')    echo "AIDO MediaPlayer backend server $VERSION"    exit 0
Aido.git/aido-server.in:45:    .B--versionB.: Output version information    .B--help -?B.: This information.    .B--offlineB.: Indicate that there is no network connection    available. Disables metaserver access.    .B--debugB.: Output more debug information    .B--no-sslB.: Run without SSL-support. A normal HTTP-port will    opened instead of a HTTPS-port.    .B--onceB.: Run the server only once, in the foreground.    The default behaviour is to run it in a loop in the    background. +  .B--kill|--stop Kill the running server, without restarting it +  .B--restart Kill the running server, restarting it afterwards    .B--log=fileB.: Use the specified file as the debug log.    default is $LOG      EOF    tput 'rmso' 2>/dev/null    exit 0    ;;    *)    ARGS="$ARGS $1"    ;;
Aido.git/aido-server.in:74:    mv -f "$LOG" "$LOG.old" 2>/dev/null   }      start_server() {    if [ ! x$DEBUG = x ] ; then    echo cd "@DIR@/programs/server"    pikeversion=`$PIKE --version 2>&1 | head -1`    echo "Pike version: $pikeversion."    echo exec $PIKE "$ARGS"    fi -  $PIKE $ARGS +  $PIKE $ARGS & +  AIDO_PID=$! +  wait $AIDO_PID +  AIDO_PID=""   }    -  + signal_exit() { +  trap "" 2 15 +  if [ "x$AIDO_PID" != "x" ]; then +  kill $AIDO_PID 2>/dev/null && wait $AIDO_PID 2>/dev/null +  fi +  exit + } +  + signal_hup() { +  if [ "x$AIDO_PID" != "x" ]; then +  kill $AIDO_PID 2>/dev/null +  fi + } +  + AIDO_PID=""   if [ x$once = 'x0' ] ; then    echo Starting server in the background.    ( -  +  trap signal_exit 2 15 +  trap signal_hup 1 +     while : ; do    rotate_log ;    start_server > $LOG 2>&1 < /dev/null    done    ) & -  +  echo $! >$HOME/.aido/pid   else -  +  trap signal_exit 2 15 +  echo $$ >$HOME/.aido/pid    start_server   fi