init_script

来自「file system in user space ! It s very go」· 代码 · 共 54 行

TXT
54
字号
#! /bin/sh## fuse		Init script for Filesystem in Userspace## Author:	Miklos Szeredi <miklos@szeredi.hu>set -ePATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/binSCRIPTNAME=/etc/init.d/fuseDESC="FUSE"MOUNTPOINT=/sys/fs/fuse/connections# Gracefully exit if the package has been removed.which fusermount &>/dev/null || exit 0error(){	echo "Error $1" >&2	exit 1}case "$1" in  start)	echo -n "Starting $DESC: "	if ! grep -qw fuse /proc/filesystems; then		modprobe fuse >/dev/null 2>&1 || error "loading fuse module"	fi	if grep -qw fusectl /proc/filesystems && \	   ! grep -qw $MOUNTPOINT /proc/mounts; then		mount -t fusectl fusectl $MOUNTPOINT >/dev/null 2>&1 || \			error "mounting control filesystem"	fi	echo "done."	;;  stop)	echo -n "Stopping $DESC: "	if grep -qw $MOUNTPOINT /proc/mounts; then		umount $MOUNTPOINT >/dev/null 2>&1 || \			error "unmounting control filesystem"	fi	if grep -qw "^fuse" /proc/modules; then		rmmod fuse >/dev/null 2>&1 || error "unloading fuse module"	fi	echo "done."	;;  *)	echo "Usage: $SCRIPTNAME {start|stop}" >&2	exit 1	;;esacexit 0

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?