HDR-Fox T2 1.03.12/3.00
humax/mnt/hd2/mod# cat /mod/etc/profile/zz
if [ -x /mod/bin/busybox/sh ]; then
export PS1="\h\w\# "
exec /mod/bin/busybox/sh
fi
humax/mnt/hd2/mod#
if [ -x /mod/bin/busybox/sh ]; then
export PS1="\[\033[01;32m\]\h\[\033[01;34m\] \w \# \[\033[00m\]"
exec /mod/bin/busybox/sh
fi
/etc/profile, which is in the read-only file system.Ah, you're right they don't. What's reading the files in .../profile/ then?
# Stuff for both shells
alias ls='ls -CFh'
if [ "$0" = '-sh' ]; then
# If in the default login shell and the better one is available, then...
[ -x /mod/bin/busybox/sh ] && exec /mod/bin/busybox/sh -l
else
# Things to run in the better shell only.
export PS1="\[\033[01;32m\]\h\[\033[01;34m\] \w \# \[\033[00m\]"
fi
Ah, I'm connecting via ssh, that could be the difference so the full solution is:Had to change if [ "$0" = '-sh' ]; then to if [ "$0" = '/bin/sh' ]; then to get it to work.
Great stuff !
# Stuff for both shells
alias ls='ls -CFh'
if [ "$0" = '-sh' -o "$0" = '/bin/sh' ]; then
# If in the default login shell and the better one is available, then...
[ -x /mod/bin/busybox/sh ] && exec /mod/bin/busybox/sh -l
else
# Things to run in the better shell only.
export PS1="\[\033[01;32m\]\h\[\033[01;34m\] \w \# \[\033[00m\]"
fi
It is the difference. SSH for the former and Telnet for the latter.Ah, I'm connecting via ssh, that could be the difference so the full solution is:
This doesn't work for me using Telnet. An "echo $0" produced "-/bin/sh" rather than "/bin/sh"Code:if [ "$0" = '-sh' -o "$0" = '/bin/sh' ]; then