I am working on an embedded linux router and trying to make a webpage where the user can input a desired number of CPE and have a script update that number on the router. I have a CLI where I can log in and type the following to change that number
echo "20">/proc/net/dbrctl/maxcpe which then sets the MaxCPE at 20
Here is the code for the webpage that I am using to test this
Quote:
<B>Set Max CPE</B>
<form method="get" action="cpe.sh">
<select size="3" name=cpe>
<option>5</option>
<option>10</option>
<option>20</option>
<option>32</option>
<option>64</option>
</select>
<input type="submit">
</form>
</body>
</html>
And here is the script that it is calling
Quote:
#!/bin/sh
echo \"$cpe\">/proc/net/dbrctl/maxcpe
It does not work and I am confused as to why or what I need to change. I am trying to set the webpage up to either select a number from a list like I have setup there or to have an input box, and then have that number passed into the script and have it execute as if I had typed in the string in the command line interface
So if I put let's say 4 into the input box then click the button it would be as if I was in the console/command line and typed
echo "4">/proc/net/dbrctl/maxcpe
The number has to keep the quotes around it but how do I get the number I put in the webpage placed into a variable named something like cpe and then have that number in that variable echoed like above.
When I ran this in a webpage it would output cpe.sh?cpe=20 if I select 20 but ti would not update the actual number of CPE passed to /proc/net/dbrctl/maxcpe
Thanks for any help guys, I am new to this and feel lost.