summaryrefslogtreecommitdiff
path: root/package/cifs-utils/files/cifs.init
blob: 8cc5783e201c96fc0d6196d048bff1384dba5fc6 (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
#!/bin/sh
#PKG cifs-utils
#INIT 60

case $1 in
autostop) ;;
autostart)
	exec sh $0 start
	;;
start)
	grep cifs /proc/filesystems >/dev/null 2>&1
	if [ $? -eq 0 ];then
		grep -v "^#" /etc/fstab| grep cifs >/dev/null 2>&1
		if [ $? -eq 0 ];then
			mount -a -t cifs
		fi
	else
		logger -t cifs -s "No cifs support in kernel"
	fi
	;;
stop)
	grep -v "^#" /etc/fstab| grep cifs >/dev/null 2>&1
	if [ $? -eq 0 ];then
		umount -a -t cifs
	fi
	;;
restart)
	sh $0 stop
	sh $0 start
	;;
*)
	echo "Usage: $0 {start | stop | restart}"
	exit 1
	;;
esac
exit $?