1

I have an Asus router (RT-AC51U) and I would like to make a script to send some information from the router through serial. I've already programmed this script and it is running as wanted. After changing the mode of the file to being executable, I would like to run it on each startup after rebooting the router.

How I can do it?

my shell script is :

#!/bin/sh

for i in 1 2 3 4 5 6 7 8 9 10
do
      my_RX=`cat /sys/class/net/vlan2/statistics/rx_bytes`
      my_TX=`cat /sys/class/net/vlan2/statistics/tx_bytes`
      echo "data*"$my_RX"*"$my_TX"*" > /dev/ttyS1
      sleep 2s
 done

where The firmware of the router is 30043808497 this firmware is NOT DD-WRT version

fronsoi
  • 11
  • 2
  • Does the router has some sort of shell ? in that case, you could install crontab if it's possible than write a script to run it periodically or at the start up of the device. – hatirlatici Feb 22 '20 at 15:15
  • I have edited your question a bit. It would certainly help if you provide some more information about what you have done so far. E. g. showing the script you want to run, giving some more information about the OS of the router, paths etc. You also tagged your question with `wscript.shell` and `bash` - it is a bit unclear to me what `wscript.shell` means. Possibly these two tags are contradictory to each other (but I'm not sure). – colidyre Feb 22 '20 at 15:59
  • Hello dear , Thanks a lot for your help and for your notes .I added the script and edited. I have /jffs folder that i can save my script and keeping in the folder after rebooting. – fronsoi Feb 23 '20 at 10:41

0 Answers0