Project

General

Profile

Actions

Bug #10855

closed

Error when executing playback thu pfSsh.php (Fatal error: Cannot redeclare usage())

Added by Marcus Oliveira over 5 years ago. Updated over 5 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
-
Category:
PHP Interpreter
Target version:
-
Start date:
08/30/2020
Due date:
% Done:

0%

Estimated time:
Plus Target Version:
Release Notes:
Affected Version:
2.5.0
Affected Architecture:
amd64

Description

Input file :
[2.5.0-DEVELOPMENT][]/root: cat -vet ipsec.txt
playback svc stop ipsec$
playback svc start ipsec$
$
[2.5.0-DEVELOPMENT][]/root:

When executing '/usr/local/sbin/pfSsh.php < /root/ipsec.txt' :
[2.5.0-DEVELOPMENT][]/root: /usr/local/sbin/pfSsh.php < /root/ipsec.txt
Starting the pfSense developer shell....

Welcome to the pfSense developer shell
Type "help" to show common usage scenarios.
Available playback commands:
changepassword disablecarp disablecarpmaint disabledhcpd disablereferercheck enableallowallwan enablecarp enablecarpmaint enablesshd externalconfiglocator gatewaystatus generateguicert gitsync installpkg listpkg pfanchordrill pftabledrill removepkgconfig removeshaper resetwebgui restartallwan restartdhcpd restartipsec svc uninstallpkg
pfSense shell: playback svc stop ipsec
Playback of file svc started.
Attempting to issue stop to ipsec service...
ipsec has been stopped.
pfSense shell: playback svc start ipsec
Playback of file svc started.
Fatal error: Cannot redeclare usage() (previously declared in /usr/local/sbin/pfSsh.php(374) : eval()'d code:30) in /usr/local/sbin/pfSsh.php(374) : eval()'d code on line 29
PHP ERROR: Type: 64, File: /usr/local/sbin/pfSsh.php(374) : eval()'d code, Line: 29, Message: Cannot redeclare usage() (previously declared in /usr/local/sbin/pfSsh.php(374) : eval()'d code:30)
[2.5.0-DEVELOPMENT][]/root:
Actions #2

Updated by Jim Pingle over 5 years ago

  • Status changed from New to Rejected

That isn't a supported method to run multiple playback scripts, they each expect to be run in their own environment.

Use this instead in the shell or shell script directly:

pfSsh.php playback svc stop ipsec
pfSsh.php playback svc start ipsec
Actions

Also available in: Atom PDF