Parse error: syntax error, unexpected 'escapeshellarg'...with the latest 2.7.0-devel snaphot
-
If you encounter the following error:
You can fix this by adding a period "." before the first "escapeshellarg" in the line.
pfSense version for reference:
FreeBSD 12.3-STABLE devel-12-n226748-9219b4ca579 pfSense 2.7.0.a.20220219.0600
Commit for further reference:
https://github.com/pfsense/pfsense/commit/47eecb1666078d8183543c13a2bf9c2e77838838
The correct line of code should be this one:
mwexec("/sbin/ifconfig " . escapeshellarg($laggif) . " laggproto " . escapeshellarg($lagg['proto']) . " {$lacptimeout} {$lagghash}");
You can use nano, vi, vim, etc. to do this.
Example:sudo nano +1107 /etc/inc/interfaces.inc
Save and type reboot.
Guys this is not the first time you don't check your code. It happened last summer also.
Please learn from mistakes. -
@nrgia how to edit interface file while in amnesiac prompt ????
-
I just had to reinstall pfSense for the same reason. And for me its also the second time that I face a not properly booting snapshot.
I do not a snapshot release to be guaranteed problemfree, however IMHO you might expect it to boot properly !!
Louis
-
@dreamworld
I explained how to do it with "nano" CLI editor.
But Nano doesn't come by default with pfSense. I will explain with "vi"editorMake sure you don't save the file if you type something wrong
vi +1107 /etc/inc/interfaces.inc
The above will open the interfaces.inc file in "vi"editor and take you directly to line 1107
in order to start editing you press Insert and use the keyboard arrows. After you finish editing, in order to save the changes you do this:
- Hit Escape
- Shift and :
- wq (which means write+quit)
If you do some mistakes, you can quit without saving the changes by doing the following:
- Hit Escape
- Combination: Shift and :
- q! (which means quit without saving changes
Hope it helps, and don't forget to reboot.
Login with root user in order to be able to have write permissions
-
@louis2
So looks like I'll have to reinstall 18 snapshot??? !!! -
@dreamworld Try first what I proposed, for me it worked
-
@nrgia
Thkx a lot folk. -
@NRgia Thanks, that fixed mine too!
Because of this experience, I don't want to continue using development snapshots. Is there any way to go back to 2.6 stable and still have my configuration intact?
-
@kevindd992002 said in Parse error: syntax error, unexpected 'escapeshellarg'...with the latest 2.7.0-devel snaphot:
@NRgia Thanks, that fixed mine too!
Because of this experience, I don't want to continue using development snapshots. Is there any way to go back to 2.6 stable and still have my configuration intact?
- First back up your config
- You can try to switch the update train from Development branch to Stable branch. But if the code changed to much I don't know if it will work. If it doesn't
- Reinstall and restore the backup file you saved previously.
For myself I use the latest Devel branch in order to test and to have the latest fixes. But if this still keep on happening I will consider your approach also :)
-
I first did tried to solve the issue by renaming kernel to kernel.notok and kernel.old to kernel. However that did not work.
So I decided to install 2.6 final and reload the latest config.
Note that I always have an downloaded recent image, available to burn on an usb-stick. That combined with a second usb-stick with a recent config allows me to restore the router in emergency cases. I normally should not need that procedure of course.
Now and than I am considering to add a second ssd in the router to make it dual boot.
-
@nrgia said in Parse error: syntax error, unexpected 'escapeshellarg'...with the latest 2.7.0-devel snaphot:
I explained how to do it with "nano" CLI editor.
But Nano doesn't come by default with pfSense. I will explain with "vi"editorYou can use the Easy Editor
ee
, which is included by default.Steve
-
@stephenw10 said in Parse error: syntax error, unexpected 'escapeshellarg'...with the latest 2.7.0-devel snaphot:
@nrgia said in Parse error: syntax error, unexpected 'escapeshellarg'...with the latest 2.7.0-devel snaphot:
I explained how to do it with "nano" CLI editor.
But Nano doesn't come by default with pfSense. I will explain with "vi"editorYou can use the Easy Editor
ee
, which is included by default.Steve
I did not heard about "easy editor" until now. I think it's a BSD thing. Anyways both "vi" and "ee" are included.
Thanks for the info about "ee". -