Hi, I have problems with PATH setting on my router when using the Plink programme.
I have Mercurial on the router and I access it via SSH from my PC using the TortoiseHg that uses Plink.
Any attment to connect with the server ends up with following failure notice:
sh: hg: not found
I have found out that this is due to incorrect setting of PATH to programmes istalled in /opt when accessing via Plink.
When logged in via Putty, the path is:
Code:
/opt/sbin:/opt/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/scripts
When I use Plink without entering any command to run, I stay logged in and the PATH record is the same as the one mentioned above:
Code:
c:\Program Files (x86)>plink -ssh -2 n16
login as: root
[root@n16 root]$ echo $PATH
/opt/sbin:/opt/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/scripts
[root@badboy root]$
When I use Plink and enter a command to run, the path setting is not correct.
Code:
c:\Program Files (x86)>plink -ssh -2 n16 echo $PATH
login as: root
/usr/bin:/bin
c:\Program Files (x86)>
PATH is set in /etc/profile
Code:
# /etc/profile
export PATH=/opt/sbin:/opt/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
export PS1="[\u@\h \W]\$ "
[ -x /usr/local/etc/profile ] && . /usr/local/etc/profile
[ -x /opt/etc/profile ] && . /opt/etc/profile
and /opt/etc/profile
Code:
export PATH=$PATH:/opt/scripts
Any ideas on what the problem might be? I have searched various forums, with no results so far.
On WL-500W with Oleg FW i had no problem.
My current configuration is Asus RT-N16 + FW RT-N16-1.9.2.7-rtn-r4667 + Entware.
Thanks a lot.
pSa