summaryrefslogtreecommitdiffstats
path: root/bsp/meta-boundary/recipes-boundary/app-startup/files/app
blob: 32f7ae4a9a7632d28604de39b1986396a77f2da7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/sh
### BEGIN INIT INFO
# Provides: app
# Required-Start:    wifi
# Required-Stop:     wifi
# Default-Start:     S
# Default-Stop:
#
# install with update-rc.d app start 80 5 .
#
# SPDX-License-Identifier:	LGPL-3.0+
#
### END INIT INFO

case "$1" in
  start)
	echo -n "Starting application"
        daemonize /app/run-app
	echo "done"
	;;
  stop)
	echo -n "Stopping application"
        /app/stop-app
	echo "done"
	;;
  restart)
	$0 stop
	$0 start
	;;
  status)
    pid=`pidof -x run-app`
    if [ -n "$pid" ]; then
        echo "run-app (pid $pid) is running ..."
        exit 2
    else
        echo "run-app is stopped"
    fi
    ;;
  *)
	echo "Usage: app { start | stop | restart | status }" >&2
	exit 1
	;;
esac

exit 0