| Revision 2498,
1.1 KB
checked in by chris, 3 years ago
(diff) |
|
Change default location for config files from /etc/box to
/etc/boxbackup, thanks to Reinhard Tartler and the Debian Project.
|
| Line | |
|---|
| 1 | #! /bin/sh |
|---|
| 2 | |
|---|
| 3 | # Start and stop the Box Backup server daemon. |
|---|
| 4 | # Originally by James Stark, modified by Chris Wilson and James O'Gorman |
|---|
| 5 | # For support, visit http://www.boxbackup.org/trac/wiki/MailingLists |
|---|
| 6 | |
|---|
| 7 | NAME=bbstored |
|---|
| 8 | LONGNAME="Box Backup Server daemon" |
|---|
| 9 | BINARY=@sbindir_expanded@/$NAME |
|---|
| 10 | CONFIG=@sysconfdir_expanded@/boxbackup/$NAME.conf |
|---|
| 11 | PIDFILE=@localstatedir_expanded@/run/$NAME.pid |
|---|
| 12 | |
|---|
| 13 | test -x $BINARY || exit 0 |
|---|
| 14 | test -f $CONFIG || exit 0 |
|---|
| 15 | |
|---|
| 16 | start_stop() { |
|---|
| 17 | start-stop-daemon --quiet --exec $BINARY --pidfile $PIDFILE "$@" |
|---|
| 18 | } |
|---|
| 19 | |
|---|
| 20 | start_stop_verbose() { |
|---|
| 21 | if start_stop "$@"; then |
|---|
| 22 | echo "." |
|---|
| 23 | else |
|---|
| 24 | echo " failed!" |
|---|
| 25 | exit 1 |
|---|
| 26 | fi |
|---|
| 27 | } |
|---|
| 28 | |
|---|
| 29 | case $1 in |
|---|
| 30 | start) |
|---|
| 31 | echo -n "Starting $LONGNAME: $NAME" |
|---|
| 32 | start_stop_verbose --start |
|---|
| 33 | ;; |
|---|
| 34 | |
|---|
| 35 | stop) |
|---|
| 36 | echo -n "Stopping $LONGNAME: $NAME" |
|---|
| 37 | start_stop_verbose --stop |
|---|
| 38 | ;; |
|---|
| 39 | |
|---|
| 40 | reload|force-reload) |
|---|
| 41 | echo -n "Reloading $LONGNAME configuration" |
|---|
| 42 | start_stop_verbose --stop --signal 1 |
|---|
| 43 | ;; |
|---|
| 44 | |
|---|
| 45 | restart) |
|---|
| 46 | echo -n "Restarting $LONGNAME: $NAME" |
|---|
| 47 | if start_stop --stop --retry 5 && start_stop --start; then |
|---|
| 48 | echo "." |
|---|
| 49 | else |
|---|
| 50 | echo " failed!" |
|---|
| 51 | exit 1 |
|---|
| 52 | fi |
|---|
| 53 | ;; |
|---|
| 54 | |
|---|
| 55 | *) |
|---|
| 56 | echo "Usage: $0 {start|stop|reload|force-reload|restart}" |
|---|
| 57 | esac |
|---|
| 58 | |
|---|
| 59 | exit 0 |
|---|
Note: See
TracBrowser
for help on using the repository browser.