Hi,
I try to run a custom script at startup of the RUTX09. The code runs when I enter it in the CLI, but it seems not to work in the custom script:
iostate1="$(ubus call ioman.gpio.din1 status | grep "value" | cut -c 12)"
if [ "$iostate1" == "1" ]; then
ubus call profile change '{"name":"OffLine2"}';
fi
What I need is to switch to another profile when the input is changed. It does change when set the profile change in the I/O Juggler, but that is only when a change in input is detected. But when the input is high at startup, the profile does not change to the desired profile.
This code does return either a 1 of 0, depending of the status of the input: ubus call ioman.gpio.din1 status | grep "value" | cut -c 12
And the startup script does run when I ignore the input state, but when I use this:
if [ "1" == "1" ]; then
ubus call profile change '{"name":"OffLine2"}';
fi
It seems that the router doesn't see the input state at startup. Anyone any idea? Thanks!