Created
November 16, 2015 20:04
-
-
Save riipandi/457c165f451f0236e888 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#chkconfig: 345 99 10 | |
#description: Seafile auto start-stop script. | |
# source function library | |
. /etc/rc.d/init.d/functions | |
start() { | |
echo "Starting Seafile server..." | |
su - seafile -c "seafile-server-latest/seafile.sh start" | |
su - seafile -c "seafile-server-latest/seahub.sh start" | |
} | |
stop() { | |
echo "Stopping Seafile process..." | |
su - seafile -c "seafile-server-latest/seafile.sh stop" | |
su - seafile -c "seafile-server-latest/seahub.sh stop" | |
} | |
restart() { | |
echo "Stopping Seafile process..." | |
su - seafile -c "seafile-server-latest/seafile.sh stop" | |
su - seafile -c "seafile-server-latest/seahub.sh stop" | |
echo "Starting Seafile server..." | |
su - seafile -c "seafile-server-latest/seafile.sh start" | |
su - seafile -c "seafile-server-latest/seahub.sh start" | |
} | |
case "$1" in | |
start) | |
start | |
;; | |
stop) | |
stop | |
;; | |
restart) | |
restart | |
;; | |
*) | |
echo "Usage: $0 start stop restart" | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment