#!/bin/sh # apprun.sh # application run script framework # All Rights Reserved. Copyright (C)2008 Xelatec, LLC # http://www.xelatec.com # Author: Steven Henke, sph@xelatec.com # # # SCRIPT MAIN # echo "Start apprun." # # check for first run # if ! [ -e $APP_CONFDIR/appfirst ]; then echo "Notice: apprun first time." chown -R asterisk:asterisk /var/www/html if ! [ $APP_OVZ = 2 ]; then /sbin/service zaptel start /usr/sbin/genzaptelconf fi touch $APP_CONFDIR/appfirst sed -i "s/^APP_FIRST.*$/APP_FIRST=1/g" $APP_CONFDIR/$APP_CONF sync sleep 5 reboot fi # if [ $APP_XIPAR = 1 ]; then echo "Notice: apprun rpt." /usr/local/bin/rpt_helper.sh /usr/local/bin/rc.updatenodelist& fi # if [ $APP_DTX = 1 ]; then echo "Notice: apprun APP_DTX." rmmod lp /usr/local/bin/ppdrv_load.sh fi # grep "^#ENABLED=1" /etc/inadyn.conf > /dev/null 2>&1 res=$? if [ $res = 0 ]; then echo "Notice: Start inadyn." /usr/src/inadyn/bin/linux/inadyn fi # # TODO - Check for kernel panic option on all in grub.conf # must do every boot since it might get updated # gives an error: # sed: cannot rename /etc//sedyqVKSA: Invalid cross-device link # #grep "panic" /etc/grub.conf > /dev/null 2>&1 #res=$? #if [ $res = 1 ]; then # sed -i "s/LABEL=\//LABEL=\/ panic=7/" /etc/grub.conf #fi # if ! [ $APP_OVZ = 2 ]; then /sbin/service zaptel start /usr/sbin/fxotune -s fi /usr/sbin/amportal start