PirateBox-Dev / PirateBoxScripts_Webserver

PirateBox Scriptcollection for running in Webserver
GNU General Public License v3.0
206 stars 102 forks source link

Update json_generation.sh #182

Closed sleepdefic1t closed 6 years ago

sleepdefic1t commented 6 years ago

First, thank you for all the hard work here!

Here's a fix to an error I encountered while working on my own implementation. Hope this can be of help!


Issue

json_generation.sh file not being run properly during installation.

Expected result

no json_generation.sh errors.

Error Thrown

/opt/arkbox/bin/json_generation.sh: 7: [: yes: unexpected operator
/opt/arkbox/bin/json_generation.sh: 7: [: yes: unexpected operator

Reproduction

sudo ./install.sh

Suggested Fix

Change ln1 of json_generation.sh

from: #!/bin/sh
to: #!/bin/bash

Results after Suggested Fix

no json_generation.sh errors.


MaStr commented 6 years ago

Exchanging the hasbang to bash is not a good solution. This will break on OpenWrt PirateBox because there is only sh available.

We should try to find the source for the issue... the best starting point is to put

set -x 

right as a 2nd line and rerun the json generation script. Then paste the complete output here...

MaStr commented 6 years ago

Do you still encounter this issue? because I implemented a fix for that on the 1.1.3 release ... I just found that you worked on the PirateBox Post https://forum.piratebox.cc/read.php?2,20140,21270#msg-21270

MaStr commented 6 years ago

Not active anymore. Hashbang with bash won't work on embedded devices.