summarylogtreecommitdiffstats
path: root/air-video-server.sh
blob: 61755061626643fdfb9647828432919dac5c7bb5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh

[ -x /etc/profile.d/openjdk6.sh ] && . /etc/profile.d/openjdk6.sh
[ -x /etc/profile.d/jdk.sh ] && . /etc/profile.d/jdk.sh
[ -x /etc/profile.d/jre.sh ] && . /etc/profile.d/jre.sh

PROPFILE='/etc/conf.d/air-video-server'
LOCALPROP=`echo ~/.air-video-server/air-video-server.properties`

([ "$1" = "verbose" ] || [ "$2" = "verbose" ]) && VERBOSE="1"
if [ -a "$1" ]; then
  PROPFILE="$1"
else 
  if [ -a "$2" ]; then
    PROPFILE="$2"
  else
    [ -a $LOCALPROP ] && PROPFILE=$LOCALPROP
  fi
fi

EXECLINE="$JAVA_HOME/bin/java -Djava.awt.headless=true -jar /usr/share/air-video-server/AirVideoServerLinux.jar "$PROPFILE""
if [ -n "$VERBOSE" ]; then
  exec $EXECLINE
else
  exec $EXECLINE > /dev/null 2> /dev/null
fi