init_elphel393 945 Bytes
Newer Older
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
1 2 3 4 5 6 7
#!/bin/sh

PATH=/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/init_elphel393
NAME=init_elphel393
DESC="extra init scripts"

Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
8
MNTPOINT=/mnt/mmc
9
MMCDEV=/dev/mmcblk0p1
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
10
SOME_SCRIPT=init_elphel393.sh
11

Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
12 13 14
case "$1" in
  start)
	echo -n "Starting $DESC: "
15
	echo "$NAME:"
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
16 17 18
	
	#add commands here
	
19 20
	#mount here
	echo "    Mounting Memory Card to $MNTPOINT"
21
	if [ ! -d $MNTPOINT ]; then 
22
		mkdir -p $MNTPOINT
23
	fi
24
	mount $MMCDEV $MNTPOINT
25 26 27 28
	
	if [ -f /etc/$SOME_SCRIPT ]; then
	    echo "    Launching /etc/$SOME_SCRIPT"
	    /etc/$SOME_SCRIPT
29 30 31
	else
	    echo "    $SOME_SCRIPT not found. Nothing to launch."
	fi
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
32 33 34 35 36
	;;
  stop)
	echo -n "Stopping $DESC: "
	echo "$NAME."
	;;
37
  restart)
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
38 39 40
	echo -n "Restarting $DESC: "
	echo "$NAME."
	;;
41 42 43 44 45 46 47 48
  status)
	echo -n "$NAME status:"
	if [ -f /var/run/$NAME ]; then
	  echo -n "Running"
	else
	  echo -n "Not running"
	fi
	;;
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
49 50
  *)
	N=/etc/init.d/$NAME
51
	echo "Usage: $N {start|stop|restart|status}" >&2
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
52 53 54 55 56
	exit 1
	;;
esac

exit 0