,The thing I needed is an amazing Dropbox-Uploader script from Andrea Fabrizi be installed on my Asus RT-N14U router with Padavan’s firmware. Dropbox-Uploader needs Bash shell to run so i had to install it. I assume Entware is already enabled in your router in Advanced Settings –> USB Apllication –> Allow Run Optware? as on the screenshot below:
Then login to router’s SSH shell and run:
1 |
opkg install bash |
Now we can use bash as:
1 |
/opt/bin/bash <myscript> |
If you want to have Bash upon login just replace corresponding line in /etc/passwd (here is an example for root user):
1 |
root:x:0:0:root:/root:/bin/ash |
by
1 |
root:x:0:0:root:/root:/bin/bash |
Unfortunatelly doing so, has the disadvantage, that you might loose the ability to log into your router at all from remote after an upgrade of your Firmware. Because optional packages like Bash are installed into /opt may be unavailable after a system-update. To prevent this accidental lock-out, it’s preferred to continue to log-in with Ash-Shell, but start Bash automatically at once after you’re successfully logged in.
To achieve this you have to create/edit the file .profile in the home account of the user the should be able to log-in on the router. Go to your home account (e.g. /root/ for the user: root) and type the following as the proper user on your router:
1 |
router$> vi .profile |
If the file has content, just add this lines to it:
1 2 3 4 5 |
# ... if [[ -x /opt/bin/bash ]]; then exec /opt/bin/bash fi |
That’s it. Next time, when root logs into the router, he is on a Bash-Shell.