1

cleanup bt_scheduler.sh

This commit is contained in:
eleksir
2016-09-04 22:50:22 +03:00
parent 9944daa36a
commit 638bfc2c90

View File

@@ -1,26 +1,31 @@
#!/bin/sh #!/bin/sh
if [ `/sbin/getcfg BTDownload Version -u -d 1.0 -f /etc/default_config/uLinux.conf` = 1.0 ]; then
if [ "$(/sbin/getcfg BTDownload Version -u -d 1.0 -f /etc/default_config/uLinux.conf)" == '1.0' ]; then
exit 1 exit 1
fi fi
case "$1" in case "$1" in
start) "start")
if [ -f /sbin/bt_scheduler ] && [ `/sbin/getcfg BTDownload Enable -u -d FALSE` = TRUE ]; then if [ -f /sbin/bt_scheduler ] && [ $(/sbin/getcfg BTDownload Enable -u -d FALSE) == 'TRUE' ]; then
echo -n "Starting DS scheduler: " echo -n "Starting DS scheduler: "
/bin/pidof bt_scheduler 1>>/dev/null 2>>/dev/null /bin/pidof bt_scheduler 1>>/dev/null 2>>/dev/null
if [ $? != 0 ]; then if [ $? != 0 ]; then
/sbin/bt_scheduler /sbin/bt_scheduler
fi fi
fi fi
;; ;;
stop) stop)
echo -n "Stop DS scheduler: " echo -n "Stop DS scheduler: "
killall bt_scheduler killall bt_scheduler
;; ;;
restart) restart)
$0 stop "$0" stop
$0 start "$0" start
;; ;;
*) *)
echo "Usage: $0 {start|stop|restart}" echo "Usage: $0 {start|stop|restart}"
exit 1 exit 1