Aido.git / aido-server.in

version» Context lines:

Aido.git/aido-server.in:1:   #!/bin/sh      DEFINES=""   ARGS="" + once=0      if [ -f @DIR@/CVS/Entries ] ; then    VERSION="cvs-@VERSION@"   else    VERSION="@VERSION@"   fi    -  + LOG='@DIR@/logs/server-debug' +    while [ ! c"$1" = "c" ] ; do    case "$1" in    -D*|-d*|-t*)    DEFINES="$DEFINES $1"    ;; -  +  '--once') +  once=1 +  ;;    '--debug'|'--with-debug'|'--enable-debug')    DEBUG=1    DEFINES="-DVP_DEBUG $DEFINES"    ;;    '--version')    echo "AIDO MediaPlayer backend server $VERSION"    exit 0    ;; -  +  '--log=*') +  LOG=`echo $1 | sed -e 's/--log=//'` +  ;;    '--help'|'-?')    sed -e "s/\\.B/`tput 'bold' 2>/dev/null`/g" -e "s/B\\./`tput 'sgr0' 2>/dev/null`/g" << EOF   This command will start the AIDO MediaPlayer backend server (version $VERSION).   Installation directory: @DIR@      Options:       .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--onceB.: Run the server only once, in the foreground. +  The default behaviour is to run it in a loop in the +  background. +  .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"    ;;    esac    shift   done      cd "@DIR@/programs/server"   ARGS="$DEFINES -M../../pike-modules main.pike $ARGS"    -  + rotate_log() { +  mv -f "$LOG.old" "$LOG.older" 2>/dev/null +  mv -f "$LOG" "$LOG.old" 2>/dev/null + } +  + start_server() {    if [ ! x$DEBUG = x ] ; then    echo cd "@DIR@/programs/server"    echo exec pike "$ARGS"    fi -  +  pike $ARGS + }    - exec pike $ARGS + if [ x$once = 'x0' ] ; then +  echo Starting server in the background. +  ( +  while : ; do +  rotate_log ; +  start_server > $LOG 2>&1 < /dev/null +  done +  ) & + else +  start_server + fi   Newline at end of file removed.