init.d/osecfs_downloads
author ft
Thu, 27 Feb 2014 17:12:59 +0100
changeset 0 60bc07f3f415
permissions -rwxr-xr-x
initial commit
ft@0
     1
#! /bin/sh
ft@0
     2
### BEGIN INIT INFO
ft@0
     3
# Provides:          osecfsmount
ft@0
     4
# Required-Start:    $all
ft@0
     5
# Required-Stop: 
ft@0
     6
# Default-Start:     2 3 4 5
ft@0
     7
# Default-Stop:	     0 1 6
ft@0
     8
# Short-Description: Mounts /home/osecuser/Downloads to /var/run/Downloads with osecfs
ft@0
     9
# Description:       Mounts /home/osecuser/Downloads to /var/run/Downloads with osecfs
ft@0
    10
### END INIT INFO
ft@0
    11
ft@0
    12
do_start () {
ft@0
    13
	#
ft@0
    14
	# If login delaying is enabled then remove the flag file
ft@0
    15
	#
ft@0
    16
	mkdir -p /var/run/Downloads
ft@0
    17
	/usr/bin/osecfs /etc/osecfs/osecfs_downloads.cfg /var/run/Downloads ro
ft@0
    18
}
ft@0
    19
ft@0
    20
do_status () {
ft@0
    21
	/bin/df -hT
ft@0
    22
}
ft@0
    23
ft@0
    24
do_stop () {
ft@0
    25
	/bin/umount /var/run/Downloads
ft@0
    26
	rmdir /var/run/Downloads
ft@0
    27
}
ft@0
    28
ft@0
    29
case "$1" in
ft@0
    30
  start)
ft@0
    31
	do_start
ft@0
    32
	;;
ft@0
    33
  restart|reload|force-reload)
ft@0
    34
	echo "Error: argument '$1' not supported" >&2
ft@0
    35
	exit 3
ft@0
    36
	;;
ft@0
    37
  stop)
ft@0
    38
	do_stop
ft@0
    39
	;;
ft@0
    40
  status)
ft@0
    41
	do_status
ft@0
    42
	exit $?
ft@0
    43
	;;
ft@0
    44
  *)
ft@0
    45
	echo "Usage: $0 start|stop" >&2
ft@0
    46
	exit 3
ft@0
    47
	;;
ft@0
    48
esac
ft@0
    49
ft@0
    50
: