Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors in 'common.sh' File #174

Closed
Austin-RR opened this issue Mar 18, 2018 · 2 comments
Closed

Errors in 'common.sh' File #174

Austin-RR opened this issue Mar 18, 2018 · 2 comments

Comments

@Austin-RR
Copy link

I am very new to this RaspAP and had some difficulty getting it to work with the "Quick Installer" method. After reading some of the other posts on how to fix things, I did get RaspAP to work. I looked a little further to try and identify what could have caused the problem in the first place. There may be as many as 4 errors in 2 lines of code in the "default_configuration" function in the "installers/common.sh" file. To be more precise, the errors are within the "lines" array and the subsequent for loop.

  1. The first element in the "lines" array should have the forward slashes (/) escaped with backslashes (\).
  2. The sed command should be run with sudo or you get a "permission denied" error.
  3. As the text "exit 0" may also appear in the comments in /etc/rc.local, the sed command should only look for a line that only contains "exit 0" by searching for: ^exit 0$.
  4. The sed command is incorrectly replacing "exit 0" with "exit0".

The original and then the corrected lines are as follows:

'echo 1 > /proc/sys/net/ipv4/ip_forward #RASPAP' (Original)
'echo 1 > \/proc\/sys\/net\/ipv4\/ip_forward #RASPAP' (Corrected)

sed -i "s/exit 0/$line\nexit0/" /etc/rc.local (Original)
sudo sed -i "s/^exit 0$/$line\nexit 0/" /etc/rc.local (Corrected)

On a clean Raspbian installation and making these edits prior to the RaspAP installation allowed RaspAP to install and operate fine.


RPi 3 Model B
Raspbian Stretch (w/Desktop) 2018-03-13

@diveyez
Copy link

diveyez commented Mar 18, 2018

Seems like this thing is broken, eh?

@billz billz closed this as completed in 98ace52 Mar 19, 2018
@billz
Copy link
Member

billz commented Mar 19, 2018

Pushed a fix for this. Many thanks @Austin-RR

@Austin-RR
Copy link
Author

Just want to give a quick confirmation that it works now as I tried the "Quick Installer" method on a clean installation of Raspbian Stretch (2018-03-13), and the script was able to successfully write to the /etc/rc.local file. Keep up the good work as this is a great project!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants