Recover soft-bricked wrongly mounted Galaxy S4 gti9506? I just rooted my SG S4 Android 5.0.1 with auto root and (a friend's) Windows Odin. Everything worked fine (root complete and SU installed) till I think I gave a bad mount command in the root directory on the phone in terminal (i guess here it went wrong, not sure. Or perhaps during installation of bash or nano) when I was installing bash and nano. Since it rebooted, I lost the wifi and cannot adb shell into my phone anymore from mac.

However, everything except the wifi is still working. Adb and usb functions are still working. I can push and pull, however I just can't enter root directories through terminal anymore. I get the following error:
- exec '/system/bin/sh' failed: Permission denied (13) -

I think my phone is still recoverable, however I don't know what to do and don't want to risk making things worse. Which andoird wizard can help this poor wifiless  guy?

Ref: http://androidforums.com/threads/guide-full-bash-shell-with-nano-tab-completion-and-color-over-ssh.124506/
Download-File: http://66.197.42.222/bashnano.zip

Below here were my bash nano install commands:

./adb shell
su 
mount -o remount,rw /system 
cp -r /storage/extSdCard/bashnano/terminfo /system/etc
cp /storage/extSdCard/bashnano/profile /etc
cp /storage/extSdCard/bashnano/bash /data
cp /storage/extSdCard/bashnano/nano /data
chmod 755 /data/bash
chmod 755 /data/nano
cd /system/bin/
mv sh sh.old
ln -s /data/bash sh
ln -s /data/bash bash
ln -s /data/nano nano

export TERMINFO=/etc/terminfo
export TERM=linux

mount -o remount,ro /system 


P.S. So I also performed a regular mount in root, which i think is what made things bad!
Ok fixed the problem by installing firmware from sammobile.com. The Odin flash failed at the hidden.img, but I could recover the thing by running the instructions here:
http://www.s4miniarchive.com/2014/07/solution-what-to-do-when-odin-fails-at-hidden.img.ext4.html

And I have my wifi back but lost root (but that's not a big deal).