What's new

What is the right nvarm syntax ?

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

octopus

Part of the Furniture
What is the right syntax to get router_name and wan_domain

router="`nvram get router_name`"
wandom="`nvram get wan_domain`"
 
In a terminal enter
Code:
nvram show
 
Yes of course, brain fart.............. didn't find what i was looking for.
Thanks

Clearly being able to issue

Code:
nvram show >nvram.txt

then opening the resulting .txt file in a suitable editor to perform a search seems beyond your skill level? ;)

However I use the following in my scripts to differentiate between my AC56 / N66

Code:
HARDWARE_MODEL=$(nvram get productid)
MYROUTER=$(nvram get computer_name)

but YMMV.

Regards,
 
Clearly being able to issue

Code:
nvram show >nvram.txt

then opening the resulting .txt file in a suitable editor to perform a search seems beyond your skill level? ;)

Personally I favor this:

Code:
nvram show | sort > nvram.txt

Makes it much easier to track down anything.
 
Thank you Rmerlin and Martineau for your help.

octopus
 
One more question:
I use: cpu="`cat /proc/dmu/temperature`"

then I get: CPU temperature : 78▒C -- that is ø
but i want to mask that after 78 and keep C

octopus
 
try
Code:
cpu="`cat /proc/dmu/temperature` | sed 's/ø//'"

or

cpu='`cat /proc/dmu/temperature` | sed 's/▒//'"
 
try
Code:
cpu="`cat /proc/dmu/temperature` | sed 's/ø//'"

or

cpu='`cat /proc/dmu/temperature` | sed 's/▒//'"

first return:
CPU temperature : 77øC | sed 's/ø//'

second return:
failed with return code 2 and error message
./sendmail.sh: line 28: syntax error: unterminated quoted string.


octopus
 
My mistake.

Code:
cpu="`cat /proc/dmu/temperature | sed 's/ø//'`"

or

cpu='`cat /proc/dmu/temperature | sed 's/▒//'`"
 
My mistake.

Code:
cpu="`cat /proc/dmu/temperature | sed 's/ø//'`"

or

cpu='`cat /proc/dmu/temperature | sed 's/▒//'`"
Thank you, first one working.
octopus
 
Similar threads
Thread starter Title Forum Replies Date
L wifi icon on top right missing if one of the bands is disabled. Asuswrt-Merlin 4

Similar threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top