Jump to content

can´t get .sh to work after reboot

LarsReviews

so my script starts with : #!/bin/sh and is saved under "relais/"

 

When I go into nano, edit and save, I can run it with ./all_on.sh and my relais turn on. Now when I restart the pi, it says -bash: ./all_on.sh: No such file or directory

 

I read through a few forum posts about this, but I didn´t quite understand what I have to do. 

Intel 4790k | Asus Z97 Maximus VII Impact | Corsair Vengeance Pro Series 16 GB 1866Mhz | Asus Strix GTX 980 | CoolerMaster G550 |Samsung Evo 250GB | Synology DS215j (NAS) | Logitech G502 |

 

Link to comment
Share on other sites

Link to post
Share on other sites

You need to provide the full path to run the file automatically if that is what you're trying to do e.g.

/home/pi/relais/all_on.sh
if that is the full path to the shell script. You also need to set the appropriate chmod attributes as the user above mentioned ^_^

Speedtests

WiFi - 7ms, 22Mb down, 10Mb up

Ethernet - 6ms, 47.5Mb down, 9.7Mb up

 

Rigs

Spoiler

 Type            Desktop

 OS              Windows 10 Pro

 CPU             i5-4430S

 RAM             8GB CORSAIR XMS3 (2x4gb)

 Cooler          LC Power LC-CC-97 65W

 Motherboard     ASUS H81M-PLUS

 GPU             GeForce GTX 1060

 Storage         120GB Sandisk SSD (boot), 750GB Seagate 2.5" (storage), 500GB Seagate 2.5" SSHD (cache)

 

Spoiler

Type            Server

OS              Ubuntu 14.04 LTS

CPU             Core 2 Duo E6320

RAM             2GB Non-ECC

Motherboard     ASUS P5VD2-MX SE

Storage         RAID 1: 250GB WD Blue and Seagate Barracuda

Uses            Webserver, NAS, Mediaserver, Database Server

 

Quotes of Fame

On 8/27/2015 at 10:09 AM, Drixen said:

Linus is light years ahead a lot of other YouTubers, he isn't just an average YouTuber.. he's legitimately, legit.

On 10/11/2015 at 11:36 AM, Geralt said:

When something is worth doing, it's worth overdoing.

On 6/22/2016 at 10:05 AM, trag1c said:

It's completely blown out of proportion. Also if you're the least bit worried about data gathering then you should go live in a cave a 1000Km from the nearest establishment simply because every device and every entity gathers information these days. In the current era privacy is just fallacy and nothing more.

 

Link to comment
Share on other sites

Link to post
Share on other sites

chmod a+x
chmod 777

and provide full path to file

Lenovo/IBM ThinkPad T61 Widescreen 15.4" 1680x1050
Intel Core2Duo T8300 2.4GHz | 3GB DDR2 from Hynix | SATA II Patched bios (Middleton) | Samsung EVO 850
Arch Linux | Linux 4.3.X x86_64

Link to comment
Share on other sites

Link to post
Share on other sites

You need to provide the full path to run the file automatically if that is what you're trying to do e.g.

/home/pi/relais/all_on.sh
if that is the full path to the shell script. You also need to set the appropriate chmod attributes as the user above mentioned ^_^

 

 

finally got some time to try it, but no luck. Is something wrong?

 

post-75265-0-99867500-1453401621.png

Intel 4790k | Asus Z97 Maximus VII Impact | Corsair Vengeance Pro Series 16 GB 1866Mhz | Asus Strix GTX 980 | CoolerMaster G550 |Samsung Evo 250GB | Synology DS215j (NAS) | Logitech G502 |

 

Link to comment
Share on other sites

Link to post
Share on other sites

finally got some time to try it, but no luck. Is something wrong?

 

attachicon.gif2016-01-21 19_38_57-Einstellungen.png

 

Typing this should run the shell script when you log in. If you wanted the system to do it automatically however, you'd need to provide the full path to the script (like in the previous post).

./relais/all_on.sh

If the shell script was saved in your home folder (/home/pi), you could call it using ./all_on.sh.

The bash shell generally accesses files relative to the current directory.

Speedtests

WiFi - 7ms, 22Mb down, 10Mb up

Ethernet - 6ms, 47.5Mb down, 9.7Mb up

 

Rigs

Spoiler

 Type            Desktop

 OS              Windows 10 Pro

 CPU             i5-4430S

 RAM             8GB CORSAIR XMS3 (2x4gb)

 Cooler          LC Power LC-CC-97 65W

 Motherboard     ASUS H81M-PLUS

 GPU             GeForce GTX 1060

 Storage         120GB Sandisk SSD (boot), 750GB Seagate 2.5" (storage), 500GB Seagate 2.5" SSHD (cache)

 

Spoiler

Type            Server

OS              Ubuntu 14.04 LTS

CPU             Core 2 Duo E6320

RAM             2GB Non-ECC

Motherboard     ASUS P5VD2-MX SE

Storage         RAID 1: 250GB WD Blue and Seagate Barracuda

Uses            Webserver, NAS, Mediaserver, Database Server

 

Quotes of Fame

On 8/27/2015 at 10:09 AM, Drixen said:

Linus is light years ahead a lot of other YouTubers, he isn't just an average YouTuber.. he's legitimately, legit.

On 10/11/2015 at 11:36 AM, Geralt said:

When something is worth doing, it's worth overdoing.

On 6/22/2016 at 10:05 AM, trag1c said:

It's completely blown out of proportion. Also if you're the least bit worried about data gathering then you should go live in a cave a 1000Km from the nearest establishment simply because every device and every entity gathers information these days. In the current era privacy is just fallacy and nothing more.

 

Link to comment
Share on other sites

Link to post
Share on other sites

finally got some time to try it, but no luck. Is something wrong?

 

attachicon.gif2016-01-21 19_38_57-Einstellungen.png

 

You've lost me here.. why are you trying to CD to a .sh file? You need to be cutting that out. I've done a bit of Pi GPIO in the past, below is my script:

#!/bin/bash# configures AnCosudo modprobe w1-gpio && sudo modprobe w1-thermfor i in 18 17 27 22 9 10 11 14 15doecho $i > /sys/class/gpio/exportecho "out" > /sys/class/gpio/gpio$i/directionecho "1" > /sys/class/gpio/gpio$i/valuedonefor i in 23 24 25doecho $i > /sys/class/gpio/exportecho "in" > /sys/class/gpio/gpio$i/directiondoneecho AnCo Launced...

I simply executed the script in /etc/rc.local

 

Let us know how you get on.

 

Andy

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×