hi , i have astra on my moi plus , but i try to use the autostart script but dont working for me , anyone one can help me
i have my file on etc/astra/cuba.lua
i need when the moi plus reboot ,start auto the astra config , thanks mikee
#!/bin/sh
### BEGIN INIT INFO
# Provides: astra
# Required-Start: $network $syslog $named
# Required-Stop: $network $syslog $named
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start/stop astra
### END INIT INFO
if [ -z "$1" ] ; then
echo "Usage: $0 [start|stop]"
exit 0
fi
ASTRA_NAME=`cuba $0`
PIDFILE="/var/run/$ASTRA_NAME.pid"
CONFIG="/etc/astra/$ASTRA_NAME.lua"
if [ "$1" = "start" ] ; then
/usr/bin/astra $CONFIG &
PID=$!
echo $PID >$PIDFILE
elif [ "$1" = "stop" ] ; then
/bin/kill $(/bin/cat $PIDFILE)
rm -f $PIDFILE
fi
#!/bin/sh
### BEGIN INIT INFO
# Provides: astra
# Required-Start: $network $syslog $named
# Required-Stop: $network $syslog $named
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start/stop astra
### END INIT INFO
set -e
if [ -z "$1" ] ; then
echo "Usage: $0 [start|stop|restart]"
exit 0
fi
if [ "$1" = "start" ] ; then
ulimit -n 65536
/usr/bin/astra --pid /var/run/astra.pid --log /var/log/astra.log -c /etc/astra/astra.conf -p 8000 --daemon
elif [ "$1" = "stop" ] ; then
kill `cat /var/run/astra.pid`
elif [ "$1" = "restart" ] ; then
$0 stop
sleep 1
$0 start
fi
Users browsing this forum: No registered users and 14 guests