ZiJocker
Posts: 1
Joined: Sat Nov 25, 2017 9:43 pm

Execute bash script via HTML

Sat Nov 25, 2017 9:56 pm

Hi,

I menaged to execute this bash script with html

Code: Select all

#!/bin/bash
gpio -g write 10 1
and it works :) it turns ON my LED
but when i add

Code: Select all

echo "1" > test.txt
at the bottom
echo line is not executed but gpio -w is working.
LED is turning ON but "1" is not written in test.txt file

file exists in same folder as script

Thnx in advance

TheRobster68
Posts: 1
Joined: Thu Dec 07, 2017 10:44 pm

Re: Execute bash script via HTML

Thu Dec 07, 2017 10:50 pm

The most likely cause of the issue is the webserver user can't write to the location the test.txt file is being written.

Change the location the file is being written to, or change the permissions on the test.txt file, so the webserver can write to it.

Return to “Networking and servers”

Who is online

Users browsing this forum: No registered users and 5 guests