Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to install timeout in OpenWRT

I need to execute a command with a timeout in OpenWRT, but it seems that the command timeout is not installed by default neither can be installed using opkg. I know that I can do a work around (using command &; sleep $DELAY; kill $!), but I wish to do this more properly without getting the risk of kill trying to kill a process in case the command finished before the timeout.

like image 252
Gabriel Diego Avatar asked Jan 09 '23 05:01

Gabriel Diego


2 Answers

Yes you can install timeout on openWRT

$ opkg update
$ opkg install coreutils-timeout
$ timeout 2 sleep 10

This has been tested with AA, pretty sure that would also work with BB.

like image 174
Noel Avatar answered Jan 17 '23 16:01

Noel


In short: it is not possible. I have to do it using sleep && kill.

like image 40
Gabriel Diego Avatar answered Jan 17 '23 18:01

Gabriel Diego