overlay_syncd 726 Bytes
Newer Older
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14
#!/bin/sh

PATH=/sbin:/bin:/usr/sbin:/usr/bin
NAME=overlay_syncd
DESC="overlay sync"

case "$1" in
  start)
	echo -n "Starting $DESC: "
	echo "$NAME:"
	;;
  stop)
	echo -n "Stopping $DESC: "
	echo "$NAME."
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
15 16 17
	if [ -f /tmp/overlay ]; then 
            rsync -av /tmp/rootfs.rw/upperdir/ /tmp/rootfs.ro/
	fi
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
18 19 20 21 22 23 24 25 26 27 28 29 30 31
	;;
  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
	;;
  sync)
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
32 33 34
        if [ -f /tmp/overlay ]; then 
            rsync -av /tmp/rootfs.rw/upperdir/ /tmp/rootfs.ro/
        fi
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
35 36 37 38 39 40 41 42 43
  ;;
  *)
	N=/etc/init.d/$NAME
	echo "Usage: $N {start|stop|restart|status|sync}" >&2
	exit 1
	;;
esac

exit 0