FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

14455 questions

17168 answers

28195 comments

0 members

We are migrating to our new platform at https://community.teltonika.lt. Moving forward, you can continue discussions on this new platform. This current platform will be temporarily maintained for reference purposes.
0 votes
143 views 0 comments
by anonymous

Why ubus call do not work in custom script?

RUTX08 | RUTX_R_00.07.04.3

# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.

sleep 60
echo "sleep done" > /tmp/script_runs
ubus call ioman.gpio.din1 status >> /tmp/script_runs
echo "DONE" >> /tmp/script_runs

exit 0

But my logfile contains only:

root@Teltonika-RUTX08:~# cat /tmp/script_runs
sleep done
DONE
root@Teltonika-RUTX08:~#

root@Teltonika-RUTX08:~# ubus call ioman.gpio.din1 status
{
    "value": "1",
    "direction": "in",
    "hr_state": "High level",
    "bi_dir": false,
    "invert_input": false
}
root@Teltonika-RUTX08:~#

Is this a bug?

1 Answer

0 votes
by anonymous

Hello,

You will need to run the script in the background. Hence, can you try changing the script like so:

(sleep 60 &&

echo "sleep done" > /tmp/script_runs

ubus call ioman.gpio.din1 status >> /tmp/script_runs

echo "DONE" >> /tmp/script_runs) &

exit 0

Let me know if it works then.

Kind Regards,

Andzej

Best answer