[RUT955] Control on/off through linux command

Is it possible to use the command to turn a task on or off, as shown in the picture below?

Hello,

You can utilize UCI commands to configure various services on your device, including enabling or disabling them. For more information on UCI, I suggest taking a look here and here.

For your specific case, if you wish to disable the data sender, you can use the following commands:

#view uci settings

  • uci show

#view modbus data sender settings

  • uci show modbus_data_sender

#disable data sender instance based on the output of the previous command

  • uci set modbus_data_sender.@data_sender[0].enabled=‘0’

#commit the UCI changes

  • uci commit

#Restart the relevant services

  • /etc/init.d/modbus_data_sender restart

Alternatively, if you want to disable the whole Modbus data sender service, you can use these commands:

  • /etc/init.d/modbus_data_sender disable
  • /etc/init.d/modbus_data_sender stop

To start the service again, you can use:

  • /etc/init.d/modbus_data_sender enable
  • /etc/init.d/modbus_data_sender start

If you wish to see a list of available services, you can execute the following command:

  • ls /etc/init.d

Kind Regards,