forked from charlie-foxtrot/RTLSDR-Airband
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrtl_airband-gentoo.sh
executable file
·40 lines (33 loc) · 973 Bytes
/
rtl_airband-gentoo.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/sbin/runscript
# rtl_airband Gentoo startup script
# (c) 2015 Tomasz Lemiech <[email protected]>
RTLAIRBAND_CONFDIR=${RTLAIRBAND_CONFDIR:-/usr/local/etc}
RTLAIRBAND_CONFIG=${RTLAIRBAND_CONFIG:-${RTLAIRBAND_CONFDIR}/rtl_airband.conf}
RTLAIRBAND_PIDFILE=${RTLAIRBAND_PIDFILE:-/run/${SVCNAME}.pid}
RTLAIRBAND_BINARY=${RTLAIRBAND_BINARY:-/usr/local/bin/rtl_airband}
depend() {
use logger dns
}
checkconfig() {
if [ ! -e "${RTLAIRBAND_CONFIG}" ] ; then
eerror "You need an ${RTLAIRBAND_CONFIG} file to run rtl_airband"
return 1
fi
}
start() {
checkconfig || return 1
ebegin "Starting ${SVCNAME}"
start-stop-daemon --start --exec "${RTLAIRBAND_BINARY}" \
--pidfile "${RTLAIRBAND_PIDFILE}" \
-- ${RTLAIRBAND_OPTS}
eend $?
}
stop() {
if [ "${RC_CMD}" = "restart" ] ; then
checkconfig || return 1
fi
ebegin "Stopping ${SVCNAME}"
start-stop-daemon --stop --exec "${RTLAIRBAND_BINARY}" \
--pidfile "${RTLAIRBAND_PIDFILE}" --quiet
eend $?
}