#!/sbin/openrc-run description="Jitsi Gateway for SIP" pidfile="/run/jigasi/jigasi.pid" # launcher script below will work on OpenRC also command="/usr/lib/jigasi/jigasi.sh" command_args=" --host=$JIGASI_HOST --domain=$JIGASI_HOSTNAME --subdomain=callcontrol --secret=$JIGASI_SECRET --logdir=$JIGASI_LOGDIR --configdir=/etc/jitsi --configdirname=jigasi $JIGASI_OPTS" command_user="jigasi:jitsi" command_background=true depend() { need net want jabber-server } start_pre() { checkpath -d -m 770 -o $command_user /run/jigasi } start() { ebegin "Starting ${name}" start-stop-daemon --start --quiet --background --chuid $command_user \ -m --pidfile $pidfile \ --exec /bin/bash -- -c "JAVA_SYS_PROPS=\"$JAVA_SYS_PROPS\" exec $command $command_args >> $JIGASI_LOGFILE 2>&1" eend $? }