What's new

What clever SSH shortcuts do you use?

  • 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!

Obviously there's lots of alternatives for desktop OS's, notepad++ plugins to full IDEs. Having shellcheck on the router itself could help stop silly mistakes while making quick and dirty edits though ssh.
Ahh of course, the presence of 'nanorc' makes you the other one who uses nano exclusively to edit files on the router! :D
How does
Code:
$(Smart_LineInsert "$FN" "$(echo -e "sh /jffs/addons/unbound/unbound.postconf \"\$1\"\t\t# unbound_manager")" )
differ from
Code:
Smart_LineInsert "$FN" "$(echo -e "sh /jffs/addons/unbound/unbound.postconf \"\$1\"\t\t# unbound_manager")"
(Bad) Habit?

Originally the function would return a text string, so
Code:
RC="$(Smart_LineInsert "$FN" "$(echo -e "sh /jffs/addons/unbound/unbound.postconf \"\$1\"\t\t# unbound_manager")" )"
as I couldn't get
Code:
RC=Smart_LineInsert "$FN" "$(echo -e "sh /jffs/addons/unbound/unbound.postconf \"\$1\"\t\t# unbound_manager")"
to work, so since I no longer return a value, I only removed the variable assignment 'RC="' string etc.
 
No, I remember thinking I still needed to find a linter.exe somewhere. I will give it another go this weekend and see where I trip up.
I thought simply installing package 'Linter-shellcheck' required the following in the Win10 Atom .config

e.g. my config
Code:
  "linter-shellcheck":
    shellcheckExecutablePath: "C:\\Asus\\Atom\\shellcheck-stable.exe"
and you manually download the Win10 'shellcheck-stable.exe' from the shellcheck site.
 
i know this is an old thread, but for these to work do i need to log in as admin? seems, umm.. a bit of a security risk
 
Cru, it's all about the Cru
 
i know this is an old thread, but for these to work do i need to log in as admin? seems, umm.. a bit of a security risk
You automatically have admin privileges. As long as you don't leave SSH open to WAN, there shouldn't a reason for concern. Unless you have script kiddies at home, but then you won't be safe anywhere...
 
well i was going to create a shortcut so that my fam could turn on/off various VPN connections, across various devices, this will ofc increase the attack surface.

As you say though, shouldn't be any reason of concern it's not on the WAN.
 
If you frequently do script editing on the router, create /jffs/configs/nanorc

isn't Vi built into Busybox?

Code:
thumper:~# ls -la /bin/vi
lrwxrwxrwx    1 root     root             7 Mar 24 06:19 /bin/vi -> busybox

sed, if I recall, is also present in busybox - nice to have for shellscripts there...

Code:
thumper:~# ls -la /bin/sed
lrwxrwxrwx    1 root     root             7 Mar 24 06:19 /bin/sed -> busybox
 
isn't Vi built into Busybox?
Yes, and it's still a major PITA to learn for anyone not already familiar with Linux shells. Nano is much more user-friendly.
 

Similar threads

Latest 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!

Staff online

Top