File tree Expand file tree Collapse file tree 2 files changed +81
-0
lines changed Expand file tree Collapse file tree 2 files changed +81
-0
lines changed Original file line number Diff line number Diff line change 1+ --root /data
2+ --hide lost+found
3+ --access-log /var/log/ghfs/access.log
4+ --error-log /var/log/ghfs/error.log
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+ #
3+ # ghfs - Go HTTP File Server
4+ #
5+ # chkconfig: 35 85 15
6+ # description: Go HTTP File Server
7+ # processname: ghfs
8+ # config: /etc/ghfs.conf
9+
10+ # Source function library.
11+ . /etc/rc.d/init.d/functions
12+
13+ # Source networking configuration.
14+ . /etc/sysconfig/network
15+
16+ # Check that networking is up.
17+ [ " $NETWORKING " = " no" ] && exit 0
18+
19+ ghfs=" /usr/local/bin/ghfs"
20+ prog=$( basename $ghfs )
21+
22+ start () {
23+ echo -n $" Starting $prog : "
24+ " $ghfs " --config=/etc/ghfs.conf &
25+ retval=$?
26+ [ $retval -eq 0 ] && success || failure
27+ echo
28+ return $retval
29+ }
30+
31+ stop () {
32+ echo -n $" Stopping $prog : "
33+ killproc " $prog "
34+ retval=$?
35+ echo
36+ return $retval
37+ }
38+
39+ restart () {
40+ stop
41+ start
42+ }
43+
44+ _status () {
45+ status $prog
46+ }
47+
48+ _status_q () {
49+ _status > /dev/null 2>&1
50+ }
51+
52+ case " $1 " in
53+ start)
54+ _status_q && exit 0
55+ $1
56+ ;;
57+ stop)
58+ _status_q || exit 0
59+ $1
60+ ;;
61+ restart|reload)
62+ restart
63+ ;;
64+ status)
65+ _status
66+ ;;
67+ status_q)
68+ _status_q
69+ ;;
70+ condrestart|try-restart)
71+ _status_q || exit 7
72+ restart
73+ ;;
74+ * )
75+ echo $" Usage: $0 {start|stop|reload|status|restart}"
76+ exit 2
77+ esac
You can’t perform that action at this time.
0 commit comments