View | Details | Raw Unified
Collapse All | Expand All

(-)service (-32 / +28 lines)
 Lines 40-75   if [ $# -eq 0 ]; then Link Here 
40
	usage 1
40
	usage 1
41
fi
41
fi
42
42
43
while [ $# -gt 0 ]; do
43
if [ $# -eq 2 -a "$2" = "--full-restart" ]; then
44
	case "$1" in
44
	SERVICE="$1"
45
		--help|-h)
45
	check_service
46
			usage 0
46
	cd / || exit
47
			;;
47
	"$SERVICEDIR/$SERVICE" stop
48
		--version|-V )
48
	"$SERVICEDIR/$SERVICE" start
49
			echo "$VERSION"
49
	exit $?
50
			exit 0
50
fi
51
			;;
52
		-*)
53
			usage 1
54
			;;
55
		*)
56
			if [ $# -eq 2 -a "$2" = "--full-restart" ]; then
57
				SERVICE="$1"
58
				check_service
59
				cd / || exit
60
				"$SERVICEDIR/$SERVICE" stop
61
				"$SERVICEDIR/$SERVICE" start
62
				exit $?
63
			elif [ -z "$SERVICE" ]; then
64
				SERVICE="$1"
65
				check_service
66
			else
67
				OPTIONS="$OPTIONS $1"
68
			fi
69
			shift
70
			;;
71
	esac
72
done
73
51
74
cd / || exit
52
case "$1" in
75
"$SERVICEDIR/$SERVICE" ${OPTIONS}
53
	--help|-h)
54
		usage 0
55
		;;
56
	--version|-V )
57
		echo "$VERSION"
58
		exit 0
59
		;;
60
	-*)
61
		usage 1
62
		;;
63
	*)
64
		SERVICE="$1"
65
		shift
66
		check_service
67
		cd / || exit
68
		"$SERVICEDIR/$SERVICE" "$@"
69
		exit $?
70
		;;
71
esac