|
@@ -1,18 +1,29 @@
|
|
#!/bin/sh
|
|
#!/bin/sh
|
|
#
|
|
#
|
|
-# Start fbvncserver
|
|
|
|
|
|
+# Start App
|
|
#
|
|
#
|
|
-
|
|
|
|
|
|
+#
|
|
|
|
+APPNAME=fbvncserver
|
|
|
|
+APPBIN=/usr/sbin/fbvncserver
|
|
|
|
+APPPAR="-t /dev/input/event1 -k /dev/null -P /etc/vncpwd"
|
|
case "$1" in
|
|
case "$1" in
|
|
start)
|
|
start)
|
|
- echo -e "Starting fbvncserevr ...\n"
|
|
|
|
- fbvncserver -t /dev/input/event1 -k /dev/null -P /etc/vncpwd &
|
|
|
|
- civetweb -document_root /var/GfA/WebVnc/novnc/ -enable_directory_listing no -listening_ports 8080 &
|
|
|
|
|
|
+ echo -e "Starting ${APPNAME} ...\n"
|
|
|
|
+ if [ ! -f ${APPBIN} ]; then
|
|
|
|
+ echo -e "Program ${APPBIN} doesn't exist \n"
|
|
|
|
+ exit 1
|
|
|
|
+ fi
|
|
|
|
+ screen -dmS ${APPNAME} sh -c "while true; do ${APPBIN} ${APPPAR}; echo '${APPNAME} stopped--> restart'; sleep 2;done"
|
|
|
|
+ exit 0
|
|
;;
|
|
;;
|
|
stop)
|
|
stop)
|
|
- echo -e "Stopping fbvncserver ...\n"
|
|
|
|
- killall civetweb
|
|
|
|
- killall fbvncserver
|
|
|
|
|
|
+ echo -e "Stopping ${APPNAME} ...\n"
|
|
|
|
+ KILLPID=`screen -list | grep ${APPNAME} | awk -F'.' '{print $1}'`
|
|
|
|
+ if [ ${#KILLPID} != "0" ]
|
|
|
|
+ then
|
|
|
|
+ kill $KILLPID
|
|
|
|
+ fi
|
|
|
|
+ exit 0
|
|
;;
|
|
;;
|
|
restart|reload)
|
|
restart|reload)
|
|
"$0" stop
|
|
"$0" stop
|
|
@@ -24,3 +35,4 @@ case "$1" in
|
|
esac
|
|
esac
|
|
|
|
|
|
exit $?
|
|
exit $?
|
|
|
|
+
|