Greg Erskine wrote: > hi Linvincible, > > I think I mentioned this earlier?? piCore only uses the standard shell > not bash. So, have you changed the very first line of each script from > #!/bin/bash to #!/bin/sh. Also the standard shell doesn't do arrays, > everything else should be OK. > > regards
Hi, yes I did change the first line to #!/bin/sh I thought the error message came from rights on the script itself but they didn't : it was the rights on files accessed inside that mattered. Weired, usually it says error at line x in these cases... Anyway I changed the rights to the files accessed and it works now. I just can't use shutdown command, any reason why? here's the script as it is now, may need a bit of refinement I'll submit it to the msldigital.com guys: #! /bin/sh # 22 is the GPIO pin receiving the shut-down signal sudo chown tc /sys/class/gpio/export sudo echo "22" > /sys/class/gpio/export sudo chown tc /sys/class/gpio/gpio22/direction sudo chown tc /sys/class/gpio/gpio22/value sudo echo "in" > /sys/class/gpio/gpio22/direction while true; do sleep 1 power=$(cat /sys/class/gpio/gpio22/value) if [ $power != 0 ]; then sudo echo "out" > /sys/class/gpio/gpio22/direction sudo echo "1" > /sys/class/gpio/gpio22/value sudo poweroff fi done Stereo - SPK: Triangle Magellan Quatuor - PRE Emotiva XSP-1 Gen2 - AMPS 4 x Emotiva XPA-1 Gen2 - SOURCES Logitech Transporter, Squeezebox Touch - CABLES Sommer Cable Epilogue XLR, Mogami 3104 for speakers HC - SPK: Triangle signature Gamma, 2x Elipson Planet M - PRE Marantz AV8801 - AMP Nuforce MCH-200C7 SE - SOURCES PS3, PopcornHour A410 - CABLES Sommer Cable Galileo XLR, Norstone W250 Multi room : B&W 705 and Monitor Audio Silver RX on leftover channels from Nuforce amp ------------------------------------------------------------------------ Linvincible's Profile: http://forums.slimdevices.com/member.php?userid=63198 View this thread: http://forums.slimdevices.com/showthread.php?t=97803 _______________________________________________ unix mailing list unix@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/unix