From c9a479c25d2b38eea740adbeac6c96629b407b00 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Sat, 17 May 2014 20:06:34 +0200 Subject: move cifs/nfs startup script back to base-files --- package/base-files/Makefile | 2 +- package/base-files/src/etc/init.d/cifs | 35 +++++++++++++++++++++++++++++ package/base-files/src/etc/init.d/nfs | 40 ++++++++++++++++++++++++++++++++++ 3 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 package/base-files/src/etc/init.d/cifs create mode 100644 package/base-files/src/etc/init.d/nfs (limited to 'package/base-files') diff --git a/package/base-files/Makefile b/package/base-files/Makefile index b665a989c..57f11a3ac 100644 --- a/package/base-files/Makefile +++ b/package/base-files/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/mk/rootfs.mk PKG_NAME:= base-files PKG_VERSION:= 1.0 -PKG_RELEASE:= 91 +PKG_RELEASE:= 92 PKG_SECTION:= base PKG_DESCR:= basic files and scripts diff --git a/package/base-files/src/etc/init.d/cifs b/package/base-files/src/etc/init.d/cifs new file mode 100644 index 000000000..ca310d70d --- /dev/null +++ b/package/base-files/src/etc/init.d/cifs @@ -0,0 +1,35 @@ +#!/bin/sh +#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 $? diff --git a/package/base-files/src/etc/init.d/nfs b/package/base-files/src/etc/init.d/nfs new file mode 100644 index 000000000..b1bce59e6 --- /dev/null +++ b/package/base-files/src/etc/init.d/nfs @@ -0,0 +1,40 @@ +#!/bin/sh +#INIT 60 +. /etc/rc.conf + +case $1 in +autostop) ;; +autostart) + test x"${rpcbind:-NO}" = x"NO" && exit 0 + exec sh $0 start + ;; +start) + grep nfs /proc/filesystems >/dev/null 2>&1 + if [ $? -eq 0 ];then + grep -v "^#" /etc/fstab| grep nfs >/dev/null 2>&1 + if [ $? -eq 0 ];then + mkdir -p /var/lib/nfs/rpc_pipefs + mount -t rpc_pipefs rpc_pipefs /var/lib/nfs/rpc_pipefs + mount -a -t nfs + fi + else + logger -s "No nfs support in kernel" + fi + ;; +stop) + grep -v "^#" /etc/fstab| grep nfs >/dev/null 2>&1 + if [ $? -eq 0 ];then + umount -a -t nfs + umount /var/lib/nfs/rpc_pipefs + fi + ;; +restart) + sh $0 stop + sh $0 start + ;; +*) + echo "Usage: $0 {start | stop | restart}" + exit 1 + ;; +esac +exit $? -- cgit v1.2.3