What's new
  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Can't execute scripts without sh

Works fine here.

ASUSWRT-Merlin RT-AC68U_3.0.0.4 Fri Jul 17 03:17:04 UTC 2015
admin@rt-ac68u:/tmp/home/root# echo "echo hi" >t.sh
admin@rt-ac68u:/tmp/home/root# chmod +x t.sh
admin@rt-ac68u:/tmp/home/root# ./t.sh
hi
admin@rt-ac68u:/tmp/home/root#
 
Works fine here.

ASUSWRT-Merlin RT-AC68U_3.0.0.4 Fri Jul 17 03:17:04 UTC 2015
admin@rt-ac68u:/tmp/home/root# echo "echo hi" >t.sh
admin@rt-ac68u:/tmp/home/root# chmod +x t.sh
admin@rt-ac68u:/tmp/home/root# ./t.sh
hi
admin@rt-ac68u:/tmp/home/root#
I need feedback if you restore to factory settings and then install optware from that guide.
 
It may be more productive to have a few people having the issue represent themselves so a root cause can be determined. If they need to prefix scripts by sh, its likely an environment issue or a busybox problem or config problem deployed as part of optware.
 
Hi, i have same problem:

admin@RT-AC68U-7538:/tmp/home/root# sh /opt/etc/init.d/S95transmission stop
: not foundit.d/S95transmission: line 2:
: not foundit.d/S95transmission: line 7:
: not foundit.d/S95transmission: line 10:
: not foundit.d/S95transmission: line 13:
: not foundit.d/S95transmission: line 17:
: not foundit.d/S95transmission: line 21:
: not foundit.d/S95transmission: line 23: {
/opt/etc/init.d/S95transmission: line 36: syntax error: unexpected word (expecting "do")
admin@RT-AC68U-7538:/tmp/home/root# echo $PATH
/bin:/usr/bin:/sbin:/usr/sbin:/home/admin:/mmc/sbin:/mmc/bin:/mmc/usr/sbin:/mmc/usr/bin:/opt/sbin:/opt/bin:/opt/usr/sbin:/opt/usr/bin
admin@RT-AC68U-7538:/tmp/home/root# echo $SHELL
/bin/sh
admin@RT-AC68U-7538:/tmp/home/root# mount
rootfs on / type rootfs (rw)
/dev/root on / type squashfs (ro,relatime)
devtmpfs on /dev type devtmpfs (rw,relatime,size=127760k,nr_inodes=31940,mode=755)
proc on /proc type proc (rw,relatime)
tmpfs on /tmp type tmpfs (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
/dev/mtdblock4 on /jffs type jffs2 (rw,noatime)
usbfs on /proc/bus/usb type usbfs (rw,relatime)
/dev/sda1 on /tmp/mnt/OPTWARE type ext2 (rw,nodev,relatime,errors=continue,user_xattr)
/dev/sdb1 on /tmp/mnt/1TB_Data type ext3 (rw,nodev,relatime,errors=continue,user_xattr,barrier=0,data=ordered)
admin@RT-AC68U-7538:/tmp/home/root#
 
I found the culprit, I have to add path to non working scripts
Code:
Code:
PATH=/opt/sbin:/opt/bin:/opt/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
 
Hi, i have same problem:

admin@RT-AC68U-7538:/tmp/home/root# sh /opt/etc/init.d/S95transmission stop
: not foundit.d/S95transmission: line 2:
: not foundit.d/S95transmission: line 7:
: not foundit.d/S95transmission: line 10:
: not foundit.d/S95transmission: line 13:
: not foundit.d/S95transmission: line 17:
: not foundit.d/S95transmission: line 21:
: not foundit.d/S95transmission: line 23: {
/opt/etc/init.d/S95transmission: line 36: syntax error: unexpected word (expecting "do")
admin@RT-AC68U-7538:/tmp/home/root# echo $PATH
/bin:/usr/bin:/sbin:/usr/sbin:/home/admin:/mmc/sbin:/mmc/bin:/mmc/usr/sbin:/mmc/usr/bin:/opt/sbin:/opt/bin:/opt/usr/sbin:/opt/usr/bin
admin@RT-AC68U-7538:/tmp/home/root# echo $SHELL
/bin/sh
admin@RT-AC68U-7538:/tmp/home/root# mount
rootfs on / type rootfs (rw)
/dev/root on / type squashfs (ro,relatime)
devtmpfs on /dev type devtmpfs (rw,relatime,size=127760k,nr_inodes=31940,mode=755)
proc on /proc type proc (rw,relatime)
tmpfs on /tmp type tmpfs (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
/dev/mtdblock4 on /jffs type jffs2 (rw,noatime)
usbfs on /proc/bus/usb type usbfs (rw,relatime)
/dev/sda1 on /tmp/mnt/OPTWARE type ext2 (rw,nodev,relatime,errors=continue,user_xattr)
/dev/sdb1 on /tmp/mnt/1TB_Data type ext3 (rw,nodev,relatime,errors=continue,user_xattr,barrier=0,data=ordered)
admin@RT-AC68U-7538:/tmp/home/root#
Code:
rm /opt/etc/init.d/S95transmission
wget -c -O /opt/etc/init.d/S95transmission http://goo.gl/aw99qs
chmod a+rx /opt/etc/init.d/S95transmission
/opt/etc/init.d/S95transmission start
/opt/etc/init.d/S95transmission stop
 

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Back
Top