Posted: Sun Oct 20, 2019 15:12 Post subject: is there a .bash_profile file somewhere
I use PuTTY on Windows to run a variety of commandline scripts on my router(s). I'd like to create a number of aliases to shortcut the commands that I run on a regular basis... similar to this article https://dev.to/jenniferlynparsons/a-few-ways-i-use-bash-2mhh
I can't seem to find the .bash_profile file. Am I missing it? Should I be looking in the PuTTY config files rather than in DD-WRT?
Joined: 04 Aug 2018 Posts: 1444 Location: Appalachian mountains, USA
Posted: Mon Oct 21, 2019 16:55 Post subject:
You'll have to investigate to see whether you can do something similar in a Windows/PuTTY environment, with which I am not familiar, but ssh in linux can be used noninteractively to send a particular command to dd-wrt. That has let me create aliases on my linux laptop to do specific actions in dd-wrt, like "v" to cause the dd-wrt vpn client to restart. It's easy enough as well to send short sequences of commands.
I create longer dd-wrt scripts, say up to 20 lines, without using /jffs by simply including something like this in the Startup Commands of the Administration>Commands GUI page:
This creates an executable script in /tmp/root/myscript using the so-called "here document" feature of linux shells. I can then either execute the script interactively in ssh or use the noninteractive approach described above to run it. _________________ 2x Netgear XR500 and 3x Linksys WRT1900ACSv2 on 53544: VLANs, VAPs, NAS, station mode, OpenVPN client (AirVPN), wireguard server (AirVPN port forward) and clients (AzireVPN, AirVPN, private), 3 DNSCrypt providers via VPN.
Setup a startup command to run a script that does things similar to this. Notice the last one needs an argument so uses a function instead of an alias.
Code:
# setup a ~/.profile file
OUTFILE=/tmp/root/.profile
Setup a startup command to run a script that does things similar to this. Notice the last one needs an argument so uses a function instead of an alias.
Code:
# setup a ~/.profile file
OUTFILE=/tmp/root/.profile
great that you found it. Sorry I pointed you to a read only one... I thought that was what you were looking for at the time, such as to verify settings or something. I also forget that I have mounted over some of the partitions
great that you found it. Sorry I pointed you to a read only one... I thought that was what you were looking for at the time, such as to verify settings or something. I also forget that I have mounted over some of the partitions