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

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

MNTPOINT=/mnt/mmc
MMCDEV=/dev/mmcblk0p1
10
CONFDIR=/etc/elphel393
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

case "$1" in
  start)
	echo -n "Starting $DESC: "
	echo "$NAME:"
	
	#add commands here
	
	#mount here
	echo "    Mounting Memory Card to $MNTPOINT"
	if [ ! -d $MNTPOINT ]; then 
		mkdir -p $MNTPOINT
	fi
	mount $MMCDEV $MNTPOINT
	
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
26
	$CONFDIR/init_elphel393.py
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
	;;
  stop)
	echo -n "Stopping $DESC: "
	echo "$NAME."
	;;
  restart)
	echo -n "Restarting $DESC: "
	echo "$NAME."
	;;
  status)
	echo -n "$NAME status:"
	if [ -f /var/run/$NAME ]; then
	  echo -n "Running"
	else
	  echo -n "Not running"
	fi
	;;
  *)
	N=/etc/init.d/$NAME
	echo "Usage: $N {start|stop|restart|status}" >&2
	exit 1
	;;
esac

exit 0