Просмотр исходного кода

Startdir for GfA Applications added

Reinhard Russinger 7 лет назад
Родитель
Сommit
42a9a86c01

+ 35 - 0
board/GfA/Display001/rootfs/etc/init.d/S99startGfA

@@ -0,0 +1,35 @@
+#!/bin/sh
+
+# start all GfA Processes
+case "$1" in
+  start)
+        echo -e "Starting GfA processes ...\n"
+	#
+	for i in /etc/init.d/init.GfA/S??* ;do
+	     # Ignore dangling symlinks (if any).
+	     [ ! -f "$i" ] && continue
+	     $i start
+	done
+        ;;
+        
+  stop)
+        echo -e "Stopping GfA processes ...\n"
+	# executing them in reversed numerical order.
+	#
+	for i in $(ls -r /etc/init.d/init.GfA/S??*) ;do
+	     # Ignore dangling symlinks (if any).
+	     [ ! -f "$i" ] && continue
+	     $i stop
+	done
+        ;;
+
+  restart|reload)
+        "$0" stop
+        "$0" start
+        ;;
+  *)
+        echo "Usage: $0 {start|stop|restart}"
+        exit 1
+esac
+
+exit $?

+ 39 - 0
board/GfA/Display001/rootfs/etc/init.d/init.GfA/M01Skeleton

@@ -0,0 +1,39 @@
+#!/bin/sh
+#
+# Start App	
+#
+#
+APPNAME=Skeleton
+APPBIN= # full qualified applicationpath
+
+
+case "$1" in
+  start)
+        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}; echo '${APPNAME} stopped--> restart'; sleep 2;done"
+        exit 0
+        ;;
+  stop)
+        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)
+        "$0" stop
+        "$0" start
+        ;;
+  *)
+        echo "Usage: $0 {start|stop|restart}"
+        exit 1
+esac
+
+exit $?
+