http://wiki.dd-wrt.com/wiki/index.php?title=Useful_Scripts&curid=1099&action=history&feed=atom Useful Scripts - Revision history 2024-03-28T09:52:43Z Revision history for this page on the wiki MediaWiki 1.10.1 http://wiki.dd-wrt.com/wiki/index.php?title=Useful_Scripts&diff=56812&oldid=prev Jeremywh7: /* Remove unused NVRAM parameters */ new section for linking 2024-02-24T19:39:51Z <p><span class="autocomment">Remove unused NVRAM parameters -</span> new section for linking</p> <table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;"> <tr> <td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td> <td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 19:39, 24 February 2024</td> </tr> <tr><td colspan="2" align="left"><strong>Line 291:</strong></td> <td colspan="2" align="left"><strong>Line 291:</strong></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">To save additional nvram space, this can instead be saved to JFFS or USB with a JFFS partition. Save to /jffs/etc/config/ with a .startup extension, make it executable, then DD-WRT will run it after every boot.</td><td> </td><td style="background: #eee; font-size: smaller;">To save additional nvram space, this can instead be saved to JFFS or USB with a JFFS partition. Save to /jffs/etc/config/ with a .startup extension, make it executable, then DD-WRT will run it after every boot.</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;"><del style="color: red; font-weight: bold; text-decoration: none;">'''Note: </del>The above commands cannot handle '=' in the parameter value, which can affect WireGuard keys and more.'''</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;">===Improved version===</ins></td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;"><del style="color: red; font-weight: bold; text-decoration: none;">&lt;br&gt;</del>Instead use:</td><td>+</td><td style="background: #cfc; font-size: smaller;">The above commands cannot handle '=' in the parameter value, which can affect WireGuard keys and more.</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">&#160;</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">'''Instead use:<ins style="color: red; font-weight: bold; text-decoration: none;">'''</ins></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"> for line in $(nvram show | grep '=$' | grep -v '=.*=' ); do var=${line%=}; nvram unset $var; done</td><td> </td><td style="background: #eee; font-size: smaller;"> for line in $(nvram show | grep '=$' | grep -v '=.*=' ); do var=${line%=}; nvram unset $var; done</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"> nvram commit</td><td> </td><td style="background: #eee; font-size: smaller;"> nvram commit</td></tr> </table> Jeremywh7 http://wiki.dd-wrt.com/wiki/index.php?title=Useful_Scripts&diff=56811&oldid=prev Jeremywh7: add improved unused nvram cleanup command 2024-02-24T19:36:07Z <p>add improved unused nvram cleanup command</p> <table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;"> <tr> <td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td> <td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 19:36, 24 February 2024</td> </tr> <tr><td colspan="2" align="left"><strong>Line 277:</strong></td> <td colspan="2" align="left"><strong>Line 277:</strong></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">daylight_time</td><td> </td><td style="background: #eee; font-size: smaller;">daylight_time</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">time_zone&lt;/pre&gt;</td><td> </td><td style="background: #eee; font-size: smaller;">time_zone&lt;/pre&gt;</td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;"></td><td colspan="2">&nbsp;</td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;">this is an updated version</td><td colspan="2">&nbsp;</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">==Remove unused NVRAM parameters==</td><td> </td><td style="background: #eee; font-size: smaller;">==Remove unused NVRAM parameters==</td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;"><del style="color: red; font-weight: bold; text-decoration: none;">This can be </del>run from telnet<del style="color: red; font-weight: bold; text-decoration: none;">/</del>ssh <del style="color: red; font-weight: bold; text-decoration: none;">to count the empty parameters</del>:</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;">To count the empty parameters </ins>run <ins style="color: red; font-weight: bold; text-decoration: none;">this </ins>from telnet <ins style="color: red; font-weight: bold; text-decoration: none;">or </ins>ssh:</td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;"><del style="color: red; font-weight: bold; text-decoration: none;">&lt;pre&gt;</del>nvram show | grep =$ | wc -l<del style="color: red; font-weight: bold; text-decoration: none;">&lt;/pre&gt;</del></td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> nvram show | grep -c =$</ins></td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;"><del style="color: red; font-weight: bold; text-decoration: none;">Then this </del>can be <del style="color: red; font-weight: bold; text-decoration: none;">used </del>as a startup script<del style="color: red; font-weight: bold; text-decoration: none;">, or from telnet/ssh</del>, or as a daily/weekly cron job<del style="color: red; font-weight: bold; text-decoration: none;">):</del></td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;">''wc'' can be used instead but there is no point, and some firmware does not have it:</ins></td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;"><del style="color: red; font-weight: bold; text-decoration: none;">&lt;pre&gt;</del>nvram <del style="color: red; font-weight: bold; text-decoration: none;">show | grep =$ | wc -l</del></td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> </ins>nvram show | grep =$ | wc -l</td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;">for line in `nvram show | grep =$ `; do var=${line%=<del style="color: red; font-weight: bold; text-decoration: none;">*</del>}; nvram unset $var; done</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;">The following </ins>can be <ins style="color: red; font-weight: bold; text-decoration: none;">run from telnet/ssh, saved </ins>as a startup script <ins style="color: red; font-weight: bold; text-decoration: none;">(webGUI ''Administration''-&gt;''Commands'')</ins>, or as a daily/weekly cron job<ins style="color: red; font-weight: bold; text-decoration: none;">. It will not work directly using '''Run Command''' without escaping special character. The ''</ins>nvram <ins style="color: red; font-weight: bold; text-decoration: none;">commit'' is technically not needed after it's been run once.</ins></td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;">nvram commit<del style="color: red; font-weight: bold; text-decoration: none;">&lt;/pre&gt;</del></td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> </ins>for line in `nvram show | grep =$ `; do var=${line%=}; nvram unset $var; done</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> </ins>nvram commit</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">Alternate version:</td><td> </td><td style="background: #eee; font-size: smaller;">Alternate version:</td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;"><del style="color: red; font-weight: bold; text-decoration: none;">&lt;pre&gt;nvram show | grep -c '=$'</del></td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> </ins>for line in $(nvram show | grep '=$'); do var=${line%=}; nvram unset &quot;$var&quot;; done</td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;">for line in $(nvram show | grep '=$'); do var=${line%=<del style="color: red; font-weight: bold; text-decoration: none;">*</del>}; nvram unset &quot;$var&quot;; done</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> </ins>nvram commit</td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;">nvram commit<del style="color: red; font-weight: bold; text-decoration: none;">&lt;/pre&gt;</del></td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;">To save additional nvram space, this </ins>can <ins style="color: red; font-weight: bold; text-decoration: none;">instead </ins>be saved to JFFS or USB with a JFFS partition<ins style="color: red; font-weight: bold; text-decoration: none;">. Save </ins>to /jffs/etc/config<ins style="color: red; font-weight: bold; text-decoration: none;">/ with </ins>a .startup extension, make it executable, then DD-WRT will run it after every boot<ins style="color: red; font-weight: bold; text-decoration: none;">.</ins></td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;"><del style="color: red; font-weight: bold; text-decoration: none;">This </del>can <del style="color: red; font-weight: bold; text-decoration: none;">alternatively </del>be saved to JFFS or USB with a JFFS partition<del style="color: red; font-weight: bold; text-decoration: none;">, then save your script </del>to /jffs/etc/config<del style="color: red; font-weight: bold; text-decoration: none;">. Give it </del>a .startup extension, make it executable, then DD-WRT will run it after every boot and use <del style="color: red; font-weight: bold; text-decoration: none;">no additional </del>nvram <del style="color: red; font-weight: bold; text-decoration: none;">space</del>.</td><td>+</td><td style="background: #cfc; font-size: smaller;">&#160;</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;">'''Note: The above commands cannot handle '=' in the parameter value, which can affect WireGuard keys </ins>and <ins style="color: red; font-weight: bold; text-decoration: none;">more.'''</ins></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;">&lt;br&gt;Instead </ins>use<ins style="color: red; font-weight: bold; text-decoration: none;">:</ins></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> for line in $(</ins>nvram <ins style="color: red; font-weight: bold; text-decoration: none;">show | grep '=$' | grep -v '=</ins>.<ins style="color: red; font-weight: bold; text-decoration: none;">*=' ); do var=${line%=}; nvram unset $var; done</ins></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> nvram commit</ins></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;">Reference: [https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_02 '''Parameter Expansion:''' ''${parameter%[word]}'']&lt;br&gt;&lt;br&gt;</ins></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">==Clear ttraff (WAN bandwidth graph) nvram data==</td><td> </td><td style="background: #eee; font-size: smaller;">==Clear ttraff (WAN bandwidth graph) nvram data==</td></tr> </table> Jeremywh7 http://wiki.dd-wrt.com/wiki/index.php?title=Useful_Scripts&diff=56182&oldid=prev Kernel-panic69: /* Remove unused NVRAM parameters */ (corrections submitted by gin-n-tonic from forum - thank you!) 2022-01-04T21:01:03Z <p><span class="autocomment">Remove unused NVRAM parameters -</span> (corrections submitted by gin-n-tonic from forum - thank you!)</p> <table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;"> <tr> <td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td> <td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 21:01, 4 January 2022</td> </tr> <tr><td colspan="2" align="left"><strong>Line 285:</strong></td> <td colspan="2" align="left"><strong>Line 285:</strong></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">Then this can be used as a startup script, or from telnet/ssh, or as a daily/weekly cron job):</td><td> </td><td style="background: #eee; font-size: smaller;">Then this can be used as a startup script, or from telnet/ssh, or as a daily/weekly cron job):</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">&lt;pre&gt;nvram show | grep =$ | wc -l</td><td> </td><td style="background: #eee; font-size: smaller;">&lt;pre&gt;nvram show | grep =$ | wc -l</td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;">for line in `nvram show | grep =$ `; do var=${line%<del style="color: red; font-weight: bold; text-decoration: none;">*</del>=}; nvram unset $var; done</td><td>+</td><td style="background: #cfc; font-size: smaller;">for line in `nvram show | grep =$ `; do var=${line%=<ins style="color: red; font-weight: bold; text-decoration: none;">*</ins>}; nvram unset $var; done</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">nvram commit&lt;/pre&gt;</td><td> </td><td style="background: #eee; font-size: smaller;">nvram commit&lt;/pre&gt;</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">Alternate version:</td><td> </td><td style="background: #eee; font-size: smaller;">Alternate version:</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">&lt;pre&gt;nvram show | grep -c '=$'</td><td> </td><td style="background: #eee; font-size: smaller;">&lt;pre&gt;nvram show | grep -c '=$'</td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;">for line in $(nvram show | grep '=$'); do var=${line%<del style="color: red; font-weight: bold; text-decoration: none;">*</del>=}; nvram unset &quot;$var&quot;; done</td><td>+</td><td style="background: #cfc; font-size: smaller;">for line in $(nvram show | grep '=$'); do var=${line%=<ins style="color: red; font-weight: bold; text-decoration: none;">*</ins>}; nvram unset &quot;$var&quot;; done</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">nvram commit&lt;/pre&gt;</td><td> </td><td style="background: #eee; font-size: smaller;">nvram commit&lt;/pre&gt;</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">This can alternatively be saved to JFFS or USB with a JFFS partition, then save your script to /jffs/etc/config. Give it a .startup extension, make it executable, then DD-WRT will run it after every boot and use no additional nvram space.</td><td> </td><td style="background: #eee; font-size: smaller;">This can alternatively be saved to JFFS or USB with a JFFS partition, then save your script to /jffs/etc/config. Give it a .startup extension, make it executable, then DD-WRT will run it after every boot and use no additional nvram space.</td></tr> </table> Kernel-panic69 http://wiki.dd-wrt.com/wiki/index.php?title=Useful_Scripts&diff=55977&oldid=prev Kernel-panic69: /* Remove unused NVRAM parameters */ 2021-08-25T02:08:56Z <p><span class="autocomment">Remove unused NVRAM parameters</span></p> <table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;"> <tr> <td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td> <td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 02:08, 25 August 2021</td> </tr> <tr><td colspan="2" align="left"><strong>Line 289:</strong></td> <td colspan="2" align="left"><strong>Line 289:</strong></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">Alternate version:</td><td> </td><td style="background: #eee; font-size: smaller;">Alternate version:</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">&lt;pre&gt;nvram show | grep -c '=$'</td><td> </td><td style="background: #eee; font-size: smaller;">&lt;pre&gt;nvram show | grep -c '=$'</td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;"><del style="color: red; font-weight: bold; text-decoration: none;">or </del>line in $(nvram show | grep '=$'); do var=${line%*=}; nvram unset &quot;$var&quot;; done</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;">for </ins>line in $(nvram show | grep '=$'); do var=${line%*=}; nvram unset &quot;$var&quot;; done</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">nvram commit&lt;/pre&gt;</td><td> </td><td style="background: #eee; font-size: smaller;">nvram commit&lt;/pre&gt;</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">This can alternatively be saved to JFFS or USB with a JFFS partition, then save your script to /jffs/etc/config. Give it a .startup extension, make it executable, then DD-WRT will run it after every boot and use no additional nvram space.</td><td> </td><td style="background: #eee; font-size: smaller;">This can alternatively be saved to JFFS or USB with a JFFS partition, then save your script to /jffs/etc/config. Give it a .startup extension, make it executable, then DD-WRT will run it after every boot and use no additional nvram space.</td></tr> </table> Kernel-panic69 http://wiki.dd-wrt.com/wiki/index.php?title=Useful_Scripts&diff=55975&oldid=prev Kernel-panic69: /* Remove unused NVRAM parameters */ 2021-08-24T15:16:52Z <p><span class="autocomment">Remove unused NVRAM parameters</span></p> <table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;"> <tr> <td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td> <td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 15:16, 24 August 2021</td> </tr> <tr><td colspan="2" align="left"><strong>Line 286:</strong></td> <td colspan="2" align="left"><strong>Line 286:</strong></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">&lt;pre&gt;nvram show | grep =$ | wc -l</td><td> </td><td style="background: #eee; font-size: smaller;">&lt;pre&gt;nvram show | grep =$ | wc -l</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">for line in `nvram show | grep =$ `; do var=${line%*=}; nvram unset $var; done</td><td> </td><td style="background: #eee; font-size: smaller;">for line in `nvram show | grep =$ `; do var=${line%*=}; nvram unset $var; done</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">nvram commit&lt;/pre&gt;</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">Alternate version:</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">&lt;pre&gt;nvram show | grep -c '=$'</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">or line in $(nvram show | grep '=$'); do var=${line%*=}; nvram unset &quot;$var&quot;; done</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">nvram commit&lt;/pre&gt;</td><td> </td><td style="background: #eee; font-size: smaller;">nvram commit&lt;/pre&gt;</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">This can alternatively be saved to JFFS or USB with a JFFS partition, then save your script to /jffs/etc/config. Give it a .startup extension, make it executable, then DD-WRT will run it after every boot and use no additional nvram space.</td><td> </td><td style="background: #eee; font-size: smaller;">This can alternatively be saved to JFFS or USB with a JFFS partition, then save your script to /jffs/etc/config. Give it a .startup extension, make it executable, then DD-WRT will run it after every boot and use no additional nvram space.</td></tr> </table> Kernel-panic69 http://wiki.dd-wrt.com/wiki/index.php?title=Useful_Scripts&diff=55792&oldid=prev Twindragon6: /* Remove unused NVRAM parameters */ 2021-02-09T02:11:44Z <p><span class="autocomment">Remove unused NVRAM parameters</span></p> <table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;"> <tr> <td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td> <td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 02:11, 9 February 2021</td> </tr> <tr><td colspan="2" align="left"><strong>Line 284:</strong></td> <td colspan="2" align="left"><strong>Line 284:</strong></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">&lt;pre&gt;nvram show | grep =$ | wc -l&lt;/pre&gt;</td><td> </td><td style="background: #eee; font-size: smaller;">&lt;pre&gt;nvram show | grep =$ | wc -l&lt;/pre&gt;</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">Then this can be used as a startup script, or from telnet/ssh, or as a daily/weekly cron job):</td><td> </td><td style="background: #eee; font-size: smaller;">Then this can be used as a startup script, or from telnet/ssh, or as a daily/weekly cron job):</td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;">&lt;pre&gt;for line in `nvram show | grep =$ `; do var=${line%*=}; nvram unset $var; done&lt;/pre&gt;</td><td>+</td><td style="background: #cfc; font-size: smaller;">&lt;pre&gt;<ins style="color: red; font-weight: bold; text-decoration: none;">nvram show | grep =$ | wc -l</ins></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">for line in `nvram show | grep =$ `; do var=${line%*=}; nvram unset $var; done</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;">nvram commit</ins>&lt;/pre&gt;</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">This can alternatively be saved to JFFS or USB with a JFFS partition, then save your script to /jffs/etc/config. Give it a .startup extension, make it executable, then DD-WRT will run it after every boot and use no additional nvram space.</td><td> </td><td style="background: #eee; font-size: smaller;">This can alternatively be saved to JFFS or USB with a JFFS partition, then save your script to /jffs/etc/config. Give it a .startup extension, make it executable, then DD-WRT will run it after every boot and use no additional nvram space.</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> </table> Twindragon6 http://wiki.dd-wrt.com/wiki/index.php?title=Useful_Scripts&diff=55628&oldid=prev Biant at 21:33, 25 May 2020 2020-05-25T21:33:59Z <p></p> <table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;"> <tr> <td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td> <td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 21:33, 25 May 2020</td> </tr> <tr><td colspan="2" align="left"><strong>Line 1:</strong></td> <td colspan="2" align="left"><strong>Line 1:</strong></td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;">You are here: '''[[Main_Page|DD-WRT wiki mainpage]] / [[Index:Scripting|Scripting]] / Useful Scripts</td><td colspan="2">&nbsp;</td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;"></td><td colspan="2">&nbsp;</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">{{Languages|Useful_Scripts}}</td><td> </td><td style="background: #eee; font-size: smaller;">{{Languages|Useful_Scripts}}</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">You are here: '''[[Main_Page|DD-WRT wiki mainpage]] / [[Index:Scripting|Scripting]] / Useful Scripts</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">Certain scripts can enhance the function of your router with DD-WRT, giving it more features or customizing it towards your needs.</td><td> </td><td style="background: #eee; font-size: smaller;">Certain scripts can enhance the function of your router with DD-WRT, giving it more features or customizing it towards your needs.</td></tr> </table> Biant http://wiki.dd-wrt.com/wiki/index.php?title=Useful_Scripts&diff=55627&oldid=prev Biant at 21:33, 25 May 2020 2020-05-25T21:33:25Z <p></p> <table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;"> <tr> <td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td> <td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 21:33, 25 May 2020</td> </tr> <tr><td colspan="2" align="left"><strong>Line 1:</strong></td> <td colspan="2" align="left"><strong>Line 1:</strong></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">You are here: '''[[Main_Page|DD-WRT wiki mainpage]] / [[Index:Scripting|Scripting]] / Useful Scripts</td><td> </td><td style="background: #eee; font-size: smaller;">You are here: '''[[Main_Page|DD-WRT wiki mainpage]] / [[Index:Scripting|Scripting]] / Useful Scripts</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;">{{Languages|<del style="color: red; font-weight: bold; text-decoration: none;">Scripting</del>}}</td><td>+</td><td style="background: #cfc; font-size: smaller;">{{Languages|<ins style="color: red; font-weight: bold; text-decoration: none;">Useful_Scripts</ins>}}</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">Certain scripts can enhance the function of your router with DD-WRT, giving it more features or customizing it towards your needs.</td><td> </td><td style="background: #eee; font-size: smaller;">Certain scripts can enhance the function of your router with DD-WRT, giving it more features or customizing it towards your needs.</td></tr> </table> Biant http://wiki.dd-wrt.com/wiki/index.php?title=Useful_Scripts&diff=55626&oldid=prev Biant at 21:32, 25 May 2020 2020-05-25T21:32:36Z <p></p> <table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;"> <tr> <td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td> <td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 21:32, 25 May 2020</td> </tr> <tr><td colspan="2" align="left"><strong>Line 1:</strong></td> <td colspan="2" align="left"><strong>Line 1:</strong></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">You are here: '''[[Main_Page|DD-WRT wiki mainpage]] / [[Index:Scripting|Scripting]] / Useful Scripts</td><td> </td><td style="background: #eee; font-size: smaller;">You are here: '''[[Main_Page|DD-WRT wiki mainpage]] / [[Index:Scripting|Scripting]] / Useful Scripts</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">{{Languages|Scripting}}</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">Certain scripts can enhance the function of your router with DD-WRT, giving it more features or customizing it towards your needs.</td><td> </td><td style="background: #eee; font-size: smaller;">Certain scripts can enhance the function of your router with DD-WRT, giving it more features or customizing it towards your needs.</td></tr> </table> Biant http://wiki.dd-wrt.com/wiki/index.php?title=Useful_Scripts&diff=53317&oldid=prev Jeremywh7: /* Remove unused NVRAM parameters */ 2017-12-06T17:50:03Z <p><span class="autocomment">Remove unused NVRAM parameters</span></p> <table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;"> <tr> <td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td> <td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 17:50, 6 December 2017</td> </tr> <tr><td colspan="2" align="left"><strong>Line 282:</strong></td> <td colspan="2" align="left"><strong>Line 282:</strong></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">This can be run from telnet/ssh to count the empty parameters:</td><td> </td><td style="background: #eee; font-size: smaller;">This can be run from telnet/ssh to count the empty parameters:</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">&lt;pre&gt;nvram show | grep =$ | wc -l&lt;/pre&gt;</td><td> </td><td style="background: #eee; font-size: smaller;">&lt;pre&gt;nvram show | grep =$ | wc -l&lt;/pre&gt;</td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;">Then this can be used as a startup script <del style="color: red; font-weight: bold; text-decoration: none;">(</del>or daily/<del style="color: red; font-weight: bold; text-decoration: none;">etc </del>cron job):</td><td>+</td><td style="background: #cfc; font-size: smaller;">Then this can be used as a startup script<ins style="color: red; font-weight: bold; text-decoration: none;">, </ins>or <ins style="color: red; font-weight: bold; text-decoration: none;">from telnet/ssh, or as a </ins>daily/<ins style="color: red; font-weight: bold; text-decoration: none;">weekly </ins>cron job):</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">&lt;pre&gt;for line in `nvram show | grep =$ `; do var=${line%*=}; nvram unset $var; done&lt;/pre&gt;</td><td> </td><td style="background: #eee; font-size: smaller;">&lt;pre&gt;for line in `nvram show | grep =$ `; do var=${line%*=}; nvram unset $var; done&lt;/pre&gt;</td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;">This can alternatively be saved to JFFS or USB with a JFFS partition, then save your script to /jffs/etc/config. Give it a .startup extension, make it executable, then DD-WRT will run it after every boot and use no additional nvram space. </td><td>+</td><td style="background: #cfc; font-size: smaller;">This can alternatively be saved to JFFS or USB with a JFFS partition, then save your script to /jffs/etc/config. Give it a .startup extension, make it executable, then DD-WRT will run it after every boot and use no additional nvram space.</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">==Clear ttraff (WAN bandwidth graph) nvram data==</td><td> </td><td style="background: #eee; font-size: smaller;">==Clear ttraff (WAN bandwidth graph) nvram data==</td></tr> </table> Jeremywh7