I decided to upgrade to 24198
i know usb script execute functionality was removed from this build but i figured i will start the script manually
suddenly i get an error which looks really basic(and easy to fix) but i can not find the problem.
this script was 100% running on 22125 firmware and looks like a valid script.
Did the remove/change scripting functionality?
this is the error i get(probably from this command device_present=Off)
the script somehow thinks i am testing something but al it does is specify some variables
[: Off: unknown operand
this is the script (used to detect if devices are present)
i know usb script execute functionality was removed from this build but i figured i will start the script manually
suddenly i get an error which looks really basic(and easy to fix) but i can not find the problem.
this script was 100% running on 22125 firmware and looks like a valid script.
Did the remove/change scripting functionality?
this is the error i get(probably from this command device_present=Off)
the script somehow thinks i am testing something but al it does is specify some variables
[: Off: unknown operand
this is the script (used to detect if devices are present)
Code:
#!/bin/sh
SamsungTV=Away
RonaldiPhone=Away
LindaiPhone=Away
LindaiPad=Away
RyaniPhone=Away
#Repeater=Away
idx=257
device_present=Off
domoticz_status=`curl -s "http://192.168.1.50:8084/json.htm?type=command¶m=getdevices&rid=257" | grep Status | awk '{print $3}' | sed 's/[",]//g'`
macadreswifi="`wl -i eth6 assoclist`;`wl -i eth7 assoclist`"
macadreswired="`ping -w 1 -q 192.168.1.10`"
case "$macadreswired" in
*1\ packets\ received*)
SamsungTV=Home
;;
esac
case "$macadreswifi" in
SamsungTV=Home
;;
esac
case "$macadreswifi" in
RonaldiPhone=Home
;;
esac
case "$macadreswifi" in
LindaiPhone=Home
;;
esac
case "$macadreswifi" in
LindaiPad=Home
;;
esac
case "$macadreswifi" in
RyaniPhone=Home
;;
esac
#case "$macadreswifi" in
#Repeater=Home
#;;
#esac
if [ "$SamsungTV" = Home -o "$RonaldiPhone" = Home -o "$LindaiPhone" = Home -o "$LindaiPad" = Home -o "$RyaniPhone" = Home -o "$Repeater" = Home ]; then
device_present=On
fi
if [ $domoticz_status != $device_present ]; then
if [ $device_present = "On" ]; then
curl -s "http://192.168.1.50:8084/json.htm?type=command¶m=switchlight&idx=$idx&switchcmd=On" > /dev/null
else
curl -s "http://192.168.1.50:8084/json.htm?type=command¶m=switchlight&idx=$idx&switchcmd=Off" > /dev/null
fi
fi
Last edited: