1

I would like to add a frequency scan-list to a ubiquity device via SSH. Here is the code I am using:

grep -v "wireless.1.scan_list" /tmp/system.cfg > /tmp/tempconfig
echo     "wireless.1.scan_list.channels=5150,5155,5160,5165,5170,5175,5180,5185,5190,5195,5200,5205,5210,5215,5220,5225,5230,5235,5240,5245,5250,5255,5260,5265,5270,5275,5280,5285,5290,5295,5300,5305,5310,5315,5320,5325,5330,5335,5340,5345,5350,5355,5360,5365,5370,5375,5380,5385,5390,5395,5400,5405,5410,5415,5420,5425,5430,5435,5440,5445,5450,5455,5460,5465,5470,5475,5480,5485,5490,5495,5500,5505,5510,5515,5520,5525,5530,5535,5540,5545,5550,5555,5560,5565,5570,5575,5580,5585,5590,5595,5600,5605,5610,5615,5620,5625,5630,5635,5640,5645,5650,5655,5660,5665,5670,5675,5680,5685,5690,5695,5700,5705,5710,5715,5720,5725,5730,5735,5740,5745,5750,5755,5760,5765,5770,5775,5780,5785,5790,5795,5800,5805,5810,5815,5820,5825,5830,5835,5840,5845,5850,5855,5860,5865,5870,5875" >> /tmp/tempconfig

echo "wireless.1.scan_list.status=enabled" >> /tmp/tempconfig

mv /tmp/tempconfig /tmp/system.cfg
save
/usr/etc/rc.d/rc.softrestart save

The only problem is that when I paste it, the "echo "wireless.1.scan_list.channels" command is incomplete(most probably due number of characters threshold on device). I then tried to break the command into two parts. That succeeded on the CMD side but when I logged to the device via http, I only saw the second batch of numbers.

I am to update about 6000 devices so that is why I cannot do this manually though the browser. Please advise...

1 Answers1

0

Just break the line:

grep -v "wireless.1.scan_list" /tmp/system.cfg > /tmp/tempconfig
printf "wireless.1.scan_list.channels=5150,5155,5160,5165,5170,5175,5180,5185,5190," > /tmp/tempconfig
printf "5195,5200,5205,5210,5215,5220,5225,5230,5235,5240,5245,5250,5255,5260,5265," >> /tmp/tempconfig
printf "5270,5275,5280,5285,5290,5295,5300,5305,5310,5315,5320,5325,5330,5335,5340," >> /tmp/tempconfig
printf "5345,5350,5355,5360,5365,5370,5375,5380,5385,5390,5395,5400,5405,5410,5415," >> /tmp/tempconfig
printf "5420,5425,5430,5435,5440,5445,5450,5455,5460,5465,5470,5475,5480,5485,5490," >> /tmp/tempconfig
printf "5495,5500,5505,5510,5515,5520,5525,5530,5535,5540,5545,5550,5555,5560,5565," >> /tmp/tempconfig
printf "5570,5575,5580,5585,5590,5595,5600,5605,5610,5615,5620,5625,5630,5635,5640," >> /tmp/tempconfig
printf "5645,5650,5655,5660,5665,5670,5675,5680,5685,5690,5695,5700,5705,5710,5715," >> /tmp/tempconfig
printf "5720,5725,5730,5735,5740,5745,5750,5755,5760,5765,5770,5775,5780,5785,5790," >> /tmp/tempconfig
printf "5795,5800,5805,5810,5815,5820,5825,5830,5835,5840,5845,5850,5855,5860,5865," >> /tmp/tempconfig
printf "5870,5875\n" >> /tmp/tempconfig
echo "wireless.1.scan_list.status=enabled" >> /tmp/tempconfig

mv /tmp/tempconfig /tmp/system.cfg
save
/usr/etc/rc.d/rc.softrestart save
terdon
  • 3,260
  • 5
  • 33
  • 57
  • just one thing...seems the "/usr/etc/rc.d/rc.softrestart save" command does not really do a soft reset. Is there a way to save without restarting the device as I have more task to do on the device in the hopes that I shall restart when all is done. Should I edit the question or start a new one? – tsietsi rampa Apr 06 '17 at 12:27
  • @tsietsirampa I have no idea, I don't know what exactly you are doing. And that isn't programming related, so you might want to post a question on [unix.se] instead. Ah, also, while I appreciate the sentiment, please don't leave comments for thanks. Instead, if an answer solved your issue, you can [accept it](http://stackoverflow.com/help/someone-answers). That will mark the question as "solved". – terdon Apr 06 '17 at 12:38