install script for FreeBSD

This commit is contained in:
badaix 2016-07-02 12:44:45 +02:00
parent 7dc6f17c3e
commit bc6529e5d6
2 changed files with 47 additions and 0 deletions

View file

@ -61,6 +61,14 @@ install:
install -D -g root -o root $(BIN) $(TARGET_DIR)/sbin/$(BIN)
install -D -g root -o root $(BIN).1 $(TARGET_DIR)/share/man/man1/$(BIN).1
else ifeq ($(TARGET), FREEBSD)
install:
echo BSD
install -g wheel -o root -m 555 $(BIN) $(TARGET_DIR)/local/sbin/$(BIN)
install -g wheel -o root -m 555 $(BIN).1 $(TARGET_DIR)/local/man/man1/$(BIN).1
install -g wheel -o root -m 555 debian/$(BIN).bsd /usr/local/etc/rc.d/$(BIN)
else
install:
@ -93,6 +101,9 @@ installsysv:
update-rc.d $(BIN) defaults; \
/etc/init.d/$(BIN) start; \
installbsd:
@echo using bsd; \
cp debian/$(BIN).bsd /usr/local/etc/rc.d/$(BIN); \
uninstall:
rm -f $(TARGET_DIR)/share/man/man1/$(BIN).1

View file

@ -0,0 +1,36 @@
#!/bin/sh
# PROVIDE: snapserver
# REQUIRE: DAEMON
# KEYWORD: Snapserver
#
# Snapserver - Snapcast server
#
# Add the following line to /etc/rc.conf to enable snapserver:
# snapserver_enable=YES
# Add snapserver_opts=<options> to configure command line arguments
snapserver_opts="-d"
. /etc/rc.subr
name=snapserver
rcvar=snapserver_enable
desc="Snapserver - Snapcast server"
load_rc_config $name
: ${snapserver_enable:=NO}
command=/usr/local/sbin/${name}
pidfile="/var/run/${name}.pid"
start_cmd=snapserver_start
snapserver_start() {
checkyesno snapserver_enable && echo "Starting snapserver." && ${command} ${snapserver_opts}
}
run_rc_command $1