test a == b is not available in e.g. dash.
Command(s) used for editing:
q=\[\"\'\]
operand="${q}?[$]?[a-zA-Z0-9_\?]+${q}?" ## doesn't detect ${VAR}
test_expr="(\[\s+${operand}\s+)==(\s+${operand}\s+\])"
find . -type f -name '[SK][0-9][0-9]*' | \
xargs sed -r -e "s@${test_expr}@\1=\2@g" -i
Signed-off-by: André Erdmann <dywi@mailerd.de>
Acked-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
start)
echo -n "Starting acpid: "
start-stop-daemon -S -q -m -b -p /var/run/acpid.pid --exec /usr/sbin/acpid -- -n
- [ $? == 0 ] && echo "OK" || echo "FAIL"
+ [ $? = 0 ] && echo "OK" || echo "FAIL"
;;
stop)
echo -n "Stopping acpid: "
start-stop-daemon -K -q -p /var/run/acpid.pid
- [ $? == 0 ] && echo "OK" || echo "FAIL"
+ [ $? = 0 ] && echo "OK" || echo "FAIL"
;;
restart)
"$0" stop
fi
echo -n "Starting domain name daemon: "
start-stop-daemon -S -x $DAEMON -- -c $CONFIG -u named
- [ $? == 0 ] && echo "OK" || echo "FAIL"
+ [ $? = 0 ] && echo "OK" || echo "FAIL"
;;
stop)
echo -n "Stopping domain name daemon: "
rndc stop || start-stop-daemon -K -x $DAEMON
- [ $? == 0 ] && echo "OK" || echo "FAIL"
+ [ $? = 0 ] && echo "OK" || echo "FAIL"
;;
restart)
$0 stop || true
start)
echo -n "Starting DHCP relay: "
start-stop-daemon -S -x /usr/sbin/dhcrelay -- -q $OPTIONS $IFCMD $SERVERS
- [ $? == 0 ] && echo "OK" || echo "FAIL"
+ [ $? = 0 ] && echo "OK" || echo "FAIL"
;;
stop)
echo -n "Stopping DHCP relay: "
start-stop-daemon -K -x /usr/sbin/dhcrelay
- [ $? == 0 ] && echo "OK" || echo "FAIL"
+ [ $? = 0 ] && echo "OK" || echo "FAIL"
;;
restart | force-reload)
$0 stop
test -d /var/lib/dhcp/ || mkdir -p /var/lib/dhcp/
test -f /var/lib/dhcp/dhcpd.leases || touch /var/lib/dhcp/dhcpd.leases
start-stop-daemon -S -x /usr/sbin/dhcpd -- -q $INTERFACES
- [ $? == 0 ] && echo "OK" || echo "FAIL"
+ [ $? = 0 ] && echo "OK" || echo "FAIL"
;;
stop)
echo -n "Stopping DHCP server: dhcpd3"
start-stop-daemon -K -x /usr/sbin/dhcpd
- [ $? == 0 ] && echo "OK" || echo "FAIL"
+ [ $? = 0 ] && echo "OK" || echo "FAIL"
;;
restart | force-reload)
$0 stop
start)
echo -n "Starting dnsmasq: "
start-stop-daemon -S -x /usr/sbin/dnsmasq
- [ $? == 0 ] && echo "OK" || echo "FAIL"
+ [ $? = 0 ] && echo "OK" || echo "FAIL"
;;
stop)
echo -n "Stopping dnsmasq: "
start-stop-daemon -K -q -x /usr/sbin/dnsmasq
- [ $? == 0 ] && echo "OK" || echo "FAIL"
+ [ $? = 0 ] && echo "OK" || echo "FAIL"
;;
restart|reload)
$0 stop
umask 077
start-stop-daemon -S -q -p /var/run/dropbear.pid \
--exec /usr/sbin/dropbear -- $DROPBEAR_ARGS
- [ $? == 0 ] && echo "OK" || echo "FAIL"
+ [ $? = 0 ] && echo "OK" || echo "FAIL"
}
stop() {
echo -n "Stopping dropbear sshd: "
start-stop-daemon -K -q -p /var/run/dropbear.pid
- [ $? == 0 ] && echo "OK" || echo "FAIL"
+ [ $? = 0 ] && echo "OK" || echo "FAIL"
}
restart() {
stop
start)
echo -n "Starting haveged: "
start-stop-daemon -S -x /usr/sbin/haveged -- -w 1024 -r 0
- [ $? == 0 ] && echo "OK" || echo "FAIL"
+ [ $? = 0 ] && echo "OK" || echo "FAIL"
;;
stop)
echo -n "Stopping haveged: "
start-stop-daemon -K -x /usr/sbin/haveged
- [ $? == 0 ] && echo "OK" || echo "FAIL"
+ [ $? = 0 ] && echo "OK" || echo "FAIL"
;;
restart|reload)
$0 stop
start)
echo "Starting inadyn: "
start-stop-daemon -S -x /usr/bin/inadyn
- [ $? == 0 ] && echo "OK" || echo "FAIL"
+ [ $? = 0 ] && echo "OK" || echo "FAIL"
;;
stop)
echo "Stopping inadyn: "
start-stop-daemon -q -K -x /usr/bin/inadyn
- [ $? == 0 ] && echo "OK" || echo "FAIL"
+ [ $? = 0 ] && echo "OK" || echo "FAIL"
rm -f /var/run/inadyn/inadyn.pid
;;
restart)
start)
echo -n "Starting openntpd: "
start-stop-daemon -S -x /usr/sbin/ntpd
- [ $? == 0 ] && echo "OK" || echo "FAIL"
+ [ $? = 0 ] && echo "OK" || echo "FAIL"
;;
stop)
echo -n "Stopping openntpd: "
start-stop-daemon -K -x /usr/sbin/ntpd
- [ $? == 0 ] && echo "OK" || echo "FAIL"
+ [ $? = 0 ] && echo "OK" || echo "FAIL"
;;
restart)
"$0" stop
start() {
echo -n "Starting SMB services: "
smbd -D
- [ $? == 0 ] && echo "OK" || echo "FAIL"
+ [ $? = 0 ] && echo "OK" || echo "FAIL"
echo -n "Starting NMB services: "
nmbd -D
- [ $? == 0 ] && echo "OK" || echo "FAIL"
+ [ $? = 0 ] && echo "OK" || echo "FAIL"
}
stop() {
echo -n "Shutting down SMB services: "
kill -9 `pidof smbd`
- [ $? == 0 ] && echo "OK" || echo "FAIL"
+ [ $? = 0 ] && echo "OK" || echo "FAIL"
echo -n "Shutting down NMB services: "
kill -9 `pidof nmbd`
- [ $? == 0 ] && echo "OK" || echo "FAIL"
+ [ $? = 0 ] && echo "OK" || echo "FAIL"
}
restart() {
reload() {
echo -n "Reloading smb.conf file: "
kill -HUP `pidof smbd`
- [ $? == 0 ] && echo "OK" || echo "FAIL"
+ [ $? = 0 ] && echo "OK" || echo "FAIL"
}
case "$1" in
start)
echo -n "Starting shairport-sync: "
start-stop-daemon -S -q -m -b -p /var/run/shairport-sync.pid --exec /usr/bin/shairport-sync -- $OPTIONS
- [ $? == 0 ] && echo "OK" || echo "FAIL"
+ [ $? = 0 ] && echo "OK" || echo "FAIL"
;;
stop)
echo -n "Stopping shairport-sync: "
start-stop-daemon -K -q -p /var/run/shairport-sync.pid
- [ $? == 0 ] && echo "OK" || echo "FAIL"
+ [ $? = 0 ] && echo "OK" || echo "FAIL"
;;
restart)
$0 stop
start() {
echo -n "Starting XBMC: "
start-stop-daemon -S -q -b -m -p $PIDFILE --exec $BIN -- $XBMC $XBMC_ARGS
- [ $? == 0 ] && echo "OK" || echo "FAIL"
+ [ $? = 0 ] && echo "OK" || echo "FAIL"
}
stop() {
echo -n "Stopping XBMC: "
start-stop-daemon -K -q -p $PIDFILE
- [ $? == 0 ] && echo "OK" || echo "FAIL"
+ [ $? = 0 ] && echo "OK" || echo "FAIL"
}
restart() {
stop