[Solved] Question about ash vs bash in openwrt

into which file are the these lines supposed to go than ?

#ENV=$HOME/.ashrc; export ENV
#. $ENV

Ok, i tried
your -rw-r--r--
mine -rw-rw--r--

work in both case

something INSIDE your ".profile" is wrong, post the
cat /root/.profile

  1. you don't need to use them
  2. no wonder there's a syntax error message
  3. did you actually look at the .profile content me and @NPeca75 posted,
1 Like

I removed the lines.
and it looks like so for now

cat .profile 
alias p9='ping'

still getting the error though

-ash: /root/.profile: Permission denied

ok, lets start from scratch
maybe you transfered .profile with winscp, or similar

cd /root
rm -f .ashrc
rm -f .profile

to get a clean working conditions
log out and again log in
there should be no error

post the output of ubus call system board too.

removed both files.
only one error left.

-ash: /root/.profile: not found

root@OpenWrt7632:~# ubus call system board
	"kernel": "5.15.137",
	"hostname": "OpenWrt7632",
	"system": "xRX200 rev 1.2",
	"model": "AVM FRITZ!Box 7362 SL",
	"board_name": "avm,fritz7362sl",
	"rootfs_type": "squashfs",
	"release": {
		"distribution": "OpenWrt",
		"version": "23.05.2",
		"revision": "r23630-842932a63d",
		"target": "lantiq/xrx200",
		"description": "OpenWrt 23.05.2 r23630-842932a63d"

did you mess with /etc/profile too ?

I just added one line

        unset FILE

geez ...

you really have no idea what you're doing :frowning:

restore the /etc/profile, and use /root/.profile for your aliases.

I did mention earlier, that I am not familiar with commands such as echo.

there's not a single echo in there, so that was inaccurate.

noooo, dont't touch anything
restore it as it was

here is original context

[ -e /tmp/.failsafe ] && export FAILSAFE=1

[ -f /etc/banner ] && cat /etc/banner
[ -n "$FAILSAFE" ] && cat /etc/banner.failsafe

grep -Fsq '/ overlay ro,' /proc/mounts && {
        echo 'Your JFFS2-partition seems full and overlayfs is mounted read-only.'
        echo 'Please try to remove files from /overlay/upper/... and reboot!'

export PATH="/usr/sbin:/usr/bin:/sbin:/bin"
export HOME=$(grep -e "^${USER:-root}:" /etc/passwd | cut -d ":" -f 6)
export HOME=${HOME:-/root}
export PS1='\u@\h:\w\$ '
export ENV=/etc/shinit

case "$TERM" in
                export PS1='\[\e]0;\u@\h: \w\a\]'$PS1

[ -n "$FAILSAFE" ] || {
        for FILE in /etc/profile.d/*.sh; do
                [ -e "$FILE" ] && . "$FILE"
        unset FILE

if ( grep -qs '^root::' /etc/shadow && \
     [ -z "$FAILSAFE" ] )
cat << EOF
=== WARNING! =====================================
There is no root password defined on this device!
Use the "passwd" command to set up a new password
in order to prevent unauthorized SSH logins.

it's finally not complaining !

root@OpenWrt7632:~# p9
PING ( 56 data bytes
64 bytes from seq=0 ttl=60 time=21.141 ms
64 bytes from seq=1 ttl=60 time=18.368 ms
64 bytes from seq=2 ttl=60 time=18.480 ms
64 bytes from seq=3 ttl=60 time=18.451 ms
--- ping statistics ---

Thx for the patience!

1 Like

glad we solved with @frollic :slight_smile:

would you please mark answer as "solution" and thread as "[solved]" ?

sure. expect I have trouble finding the button for "[solved]"

Ok, i changed the topic title [Solved] for you

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.