aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStuart Shelton <stuart@shelton.me>2016-01-11 02:47:57 +0000
committerStuart Shelton <stuart@shelton.me>2016-01-11 02:47:57 +0000
commitd179b75b1620b57cfc97471f7b329e1842faac8a (patch)
treef19b781ef9bc3e449539f0a185969d668a1fe240 /www-apps
parentAdd sys-power/apcupsd-3.14.13 (diff)
downloadsrcshelton-d179b75b1620b57cfc97471f7b329e1842faac8a.tar.gz
srcshelton-d179b75b1620b57cfc97471f7b329e1842faac8a.tar.bz2
srcshelton-d179b75b1620b57cfc97471f7b329e1842faac8a.zip
Update init scripts to remove bash-specific syntax
Diffstat (limited to 'www-apps')
-rw-r--r--www-apps/rpi-monitor/Manifest2
-rw-r--r--www-apps/rpi-monitor/files/rpimonitor.initd47
2 files changed, 28 insertions, 21 deletions
diff --git a/www-apps/rpi-monitor/Manifest b/www-apps/rpi-monitor/Manifest
index aa70496a..7712d0ec 100644
--- a/www-apps/rpi-monitor/Manifest
+++ b/www-apps/rpi-monitor/Manifest
@@ -9,7 +9,7 @@ AUX gentoo.conf-2.10.patch 25733 SHA256 c9e676d92f45fa74c17935ddd48ae3aaf93b43ea
AUX memory.conf-2.10.patch 6038 SHA256 43401a9505bbb57ce73fde7fd40fc3130f009262813cad60c4f6daaab1623a9b SHA512 6a64abdb4c0762ade0b601acc7c2913afc0889c4575dbfac71f638bab3f103002b99869a8f766005070ac6374565b3c5bf9da0cf0fd7bc6fba1c661411a45be8 WHIRLPOOL 4e5e146b4fe01e4a4167c93776dd01839ca1b59c7f0d2bedd7e2156212afb2d2ce6526f6cb3b2695fefc8fb0857d176f8a9398d0bae3e90b3f6e99ecead8c18b
AUX network.conf-2.10.patch 3269 SHA256 9fe65c3e87bd8e070552a57b8635488880ee39fd848f23176ff102c2aa6171cc SHA512 cd1b16f7b82fb442c3ba026be07cccea658f3652b872b4fcf8c08451bc5c8e31ee1bc688ffb4ec265a0d127a25fca5b686ac4649ae83a7fd1fd44c3c675c5270 WHIRLPOOL 92c68dbc929427c0198f6ead6a23c8ea2994cf3aa80ec1ef14f29b59e08f739e86accfdcc2f5d9e2f07657c6550772e840c39fb9cf440cc8bcf3c9edf0513e8d
AUX rpimonitor.confd 110 SHA256 2aec673afcf21a82b9bcfd7f686ae418d7f8246d1cf376fa7341d589ddf9021e SHA512 32fd23d631abdb71e1e827be67b4a7777a7292763c1024bd3ee34a231ad8b3d612aba8c6e17478058c764cdf2311ea141d3424e88f88f522b1931e2d800b4037 WHIRLPOOL 055f8d240ec41fbd354e815dd1136f089d0d1a50737de5ae368c0ddc6d7dd67c4415d0be8fb610a6c8963d0fd94044eb95f424ba77170e4c9fbd7e63a1abdd0f
-AUX rpimonitor.initd 1000 SHA256 953133c57d684db0c05ab80c8d7ca688e850fc056dc88db5d55c34c46055039d SHA512 069c4cacf047626e008ee284861fd4473176c65ebed3bf91959a6e6a57115a4f7f371dcae52e6fb0adbd18fcea6aa74ddaae37ea8e4d4d7067137c7ea725fe87 WHIRLPOOL 335e27d0e13b5c99a4b7a89804e5b7440726b1babfacd66e6fd1ec7e876e38c222893557e779a15d3605e25407ae1020cf85df05dea0ecb67815b8da5500f3f5
+AUX rpimonitor.initd 1105 SHA256 e9c63eb3844ae9af76e9626c444f39fe5814b72a3b6fa02c70faaa3fff310934 SHA512 9dcaaece64f432f4b0e1d567d537aeb61081fe5925c2838fc249508d28438cde62415fcbb68c3765dd3252e1bdcbcf4dc0d1d60fbb6fd0e85c32a5670d273b46 WHIRLPOOL 061b5cbbbf45606a5d27a0d68591af30e8820238fed7536c648980be150d4e574f3f0ea32ac0266ec317a8010428f27c0c20eb9629d9918edd6b6640f6ed61e8
AUX rpimonitord-2.10.patch 729 SHA256 cc9edc717d59711fdfb695a881db7e349efc138c04e2c4275adad15a393170db SHA512 e335c8424427f060a7d6f97782805329934d02db0869d58c30b23975e098358ef15bdd632274278149ed64ddb01e8070142da1815bcf11841954179420fa0ae5 WHIRLPOOL 5664539a3a23621685612d2c0569fe47cda032215bb04f5549b5f4cfa48ef59109c72f8b6219fe53c2133ada6a0f5a37ef62d460ab88cc39cfda1be0744c63aa
AUX sdcard.conf-2.10.patch 5079 SHA256 d95b9b2bc402ca25257a7fdee0098c447edf98b5f1d0531d6ab7af596e10c48d SHA512 cf6cb263ce4358805b3afbd7472aeb0ac6dc7bf4933265d990a95347271f060073d54948134026e3e8d68ad69cb7b4148c77257ad45b2d24cef8b1aa3b2f919e WHIRLPOOL 4d4460e4d1aaf5c3482dd32147347994e63901b0efdf02138fae02da3f8fcf47501b25fb3682e1b247f0e8d6c77be425e6c5d76ffe96882206f159ab7c85c966
AUX swap.conf-2.10.patch 2681 SHA256 12ea6093dc2ccde4aa10840691d791a6a9dbe35047056f5945216b8b360f87ed SHA512 bdc048c68d31e7bed4e2a29821718a7e949e3bd05c88f19f74c57d6a4ebc9e0fd30307153b266e9803a81d3f4344af034ea046c46d6a38ead079730832c85834 WHIRLPOOL 0cd0ece2cc1d5c48f0769c48f44a59bd386ca602803142cc6fef3f92e75e3aca33abfd4a7e690acb5bcb87703bb6e91040d32b79e9b6a25878ac99b6272a71a0
diff --git a/www-apps/rpi-monitor/files/rpimonitor.initd b/www-apps/rpi-monitor/files/rpimonitor.initd
index 2006848a..2a69f049 100644
--- a/www-apps/rpi-monitor/files/rpimonitor.initd
+++ b/www-apps/rpi-monitor/files/rpimonitor.initd
@@ -3,37 +3,44 @@
# Distributed under the terms of the GNU General Public License v2
PERL="$( type -pf perl )"
-NAME=rpimonitord
-PIDFILE=/var/run/$NAME.pid
-DAEMON=/usr/sbin/$NAME
-DAEMON_ARGS="-b ${PIDFILE} ${CONFFILES:+${CONFFILES}}"
+NAME="rpimonitord"
+PIDFILE="/var/run/${NAME}.pid"
+DAEMON="/usr/sbin/${NAME}"
+DAEMON_ARGS="-b ${PIDFILE}${CONFFILES:+ ${CONFFILES}}"
depend() {
need net
}
start() {
- [[ -x "$PERL" ]] || { eerror "Cannot locate perl binary" ; return 1 ; }
+ if ! [ -x "${PERL}" ]; then
+ eerror "Cannot locate perl binary"
+ return 1
+ fi
ebegin "Starting RPi Monitor"
- start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $PERL -- $DAEMON $DAEMON_ARGS
- eend $? "Unable to start RPi Monitor"
+ start-stop-daemon --start --quiet --pidfile "${PIDFILE}" --exec "${PERL}" -- "${DAEMON}" ${DAEMON_ARGS}
+ eend ${?} "Unable to start RPi Monitor"
}
stop() {
- local pid pids rc
- [[ -r "$PIDFILE" ]] && pids="$( cat "$PIDFILE" )"
+ local pid pids
+ declare -i pid
ebegin "Stopping RPi Monitor"
- start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --exec $PERL
- rc=$?
- [[ -n "$pids" ]] && for pid in $pids; do
- ps -o args= $pid | grep -q "${PIDFILE}$" && {
- eindent
- einfo "Sending HUP signal to child $pid ..."
- kill -HUP $pid
- eoutdent
- }
- done
- eend $rc "Unable to stop RPi Monitor"
+ if [ -r "${PIDFILE}" ]; then
+ pids="$( cat "${PIDFILE}" )"
+ if [ -n "${pids}" ]; then
+ for pid in ${pids}; do
+ if ps -o args= ${pid} | grep -q "${PIDFILE}$"; then
+ eindent
+ einfo "Sending HUP signal to child ${pid} ..."
+ kill -HUP ${pid}
+ eoutdent
+ fi
+ done
+ fi
+ fi
+ start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile "${PIDFILE}" --exec "${PERL}"
+ eend ${?} "Unable to stop RPi Monitor"
}