Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
e34cce34
Commit
e34cce34
authored
May 12, 2017
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rc: yes/no prompt unification
parent
a8fa1a6c
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
13 additions
and
16 deletions
+13
-16
console.inc
src/etc/inc/console.inc
+5
-5
rc.initial
src/etc/rc.initial
+3
-3
rc.initial.defaults
src/etc/rc.initial.defaults
+2
-2
rc.initial.halt
src/etc/rc.initial.halt
+1
-1
rc.initial.reboot
src/etc/rc.initial.reboot
+1
-1
rc.initial.restore
src/etc/rc.initial.restore
+1
-1
rc.initial.setports
src/etc/rc.initial.setports
+0
-3
No files found.
src/etc/inc/console.inc
View file @
e34cce34
...
@@ -53,7 +53,7 @@ function set_networking_interfaces_ports($probe = false)
...
@@ -53,7 +53,7 @@ function set_networking_interfaces_ports($probe = false)
global
$config
;
global
$config
;
$fp
=
fopen
(
'php://stdin'
,
'r'
);
$fp
=
fopen
(
'php://stdin'
,
'r'
);
$yes_no_prompt
=
'[y
|n]?
'
;
$yes_no_prompt
=
'[y
/N]:
'
;
$interactive
=
true
;
$interactive
=
true
;
$key
=
null
;
$key
=
null
;
...
@@ -95,7 +95,7 @@ EOD;
...
@@ -95,7 +95,7 @@ EOD;
You now have the opportunity to configure VLANs. If you don't require VLANs
You now have the opportunity to configure VLANs. If you don't require VLANs
for initial connectivity, say no here and use the GUI to configure VLANs later.
for initial connectivity, say no here and use the GUI to configure VLANs later.
Do you want to set up VLANs now ${yes_no_prompt}
Do you want to set up VLANs now
?
${yes_no_prompt}
EOD;
EOD;
if
(
$interactive
)
{
if
(
$interactive
)
{
$key
=
chop
(
fgets
(
$fp
));
$key
=
chop
(
fgets
(
$fp
));
...
@@ -277,7 +277,7 @@ EOD;
...
@@ -277,7 +277,7 @@ EOD;
echo
<<<EOD
echo
<<<EOD
Do you want to proceed ${yes_no_prompt}
Do you want to proceed
?
${yes_no_prompt}
EOD;
EOD;
if
(
$interactive
)
{
if
(
$interactive
)
{
$key
=
chop
(
fgets
(
$fp
));
$key
=
chop
(
fgets
(
$fp
));
...
@@ -454,7 +454,7 @@ function vlan_setup($iflist, $fp)
...
@@ -454,7 +454,7 @@ function vlan_setup($iflist, $fp)
{
{
global
$config
;
global
$config
;
$yes_no_prompt
=
'[y
|n]?
'
;
$yes_no_prompt
=
'[y
/N]:
'
;
if
(
isset
(
$config
[
'vlans'
][
'vlan'
]))
{
if
(
isset
(
$config
[
'vlans'
][
'vlan'
]))
{
...
@@ -462,7 +462,7 @@ function vlan_setup($iflist, $fp)
...
@@ -462,7 +462,7 @@ function vlan_setup($iflist, $fp)
WARNING: all existing VLANs will be cleared if you proceed!
WARNING: all existing VLANs will be cleared if you proceed!
Do you want to proceed ${yes_no_prompt}
Do you want to proceed
?
${yes_no_prompt}
EOD;
EOD;
if
(
strcasecmp
(
chop
(
fgets
(
$fp
)),
"y"
)
!=
0
)
{
if
(
strcasecmp
(
chop
(
fgets
(
$fp
)),
"y"
)
!=
0
)
{
...
...
src/etc/rc.initial
View file @
e34cce34
...
@@ -27,9 +27,9 @@ set -e
...
@@ -27,9 +27,9 @@ set -e
echo
echo
echo
" 0) Logout 7) Ping host"
echo
" 0) Logout 7) Ping host"
echo
" 1) Assign
I
nterfaces 8) Shell"
echo
" 1) Assign
i
nterfaces 8) Shell"
echo
" 2) Set interface
(s) IP address
9) pfTop"
echo
" 2) Set interface
IP address
9) pfTop"
echo
" 3) Reset the root password 10) Fi
lter Logs
"
echo
" 3) Reset the root password 10) Fi
rewall log
"
echo
" 4) Reset to factory defaults 11) Reload all services"
echo
" 4) Reset to factory defaults 11) Reload all services"
echo
" 5) Power off system 12) Upgrade from console"
echo
" 5) Power off system 12) Upgrade from console"
echo
" 6) Reboot system 13) Restore a configuration"
echo
" 6) Reboot system 13) Restore a configuration"
...
...
src/etc/rc.initial.defaults
View file @
e34cce34
...
@@ -32,13 +32,13 @@ require_once("config.inc");
...
@@ -32,13 +32,13 @@ require_once("config.inc");
require_once
(
"system.inc"
);
require_once
(
"system.inc"
);
$fp
=
fopen
(
'php://stdin'
,
'r'
);
$fp
=
fopen
(
'php://stdin'
,
'r'
);
$yes_no_prompt
=
'[y
|n]?
'
;
$yes_no_prompt
=
'[y
/N]:
'
;
echo
<<<EOD
echo
<<<EOD
You are about to reset the firewall to factory defaults.
You are about to reset the firewall to factory defaults.
The firewall will reboot after resetting the configuration.
The firewall will reboot after resetting the configuration.
Do you want to proceed {$yes_no_prompt}
Do you want to proceed
?
{$yes_no_prompt}
EOD;
EOD;
if
(
strcasecmp
(
chop
(
fgets
(
$fp
)),
'y'
)
==
0
)
{
if
(
strcasecmp
(
chop
(
fgets
(
$fp
)),
'y'
)
==
0
)
{
...
...
src/etc/rc.initial.halt
View file @
e34cce34
...
@@ -34,7 +34,7 @@ require_once("system.inc");
...
@@ -34,7 +34,7 @@ require_once("system.inc");
$fp
=
fopen
(
'php://stdin'
,
'r'
);
$fp
=
fopen
(
'php://stdin'
,
'r'
);
echo
"The system will halt and power off. Do you want to proceed [y|n]? "
;
echo
'The system will halt and power off. Do you want to proceed? [y/N]: '
;
if
(
strcasecmp
(
chop
(
fgets
(
$fp
)),
'y'
)
==
0
)
{
if
(
strcasecmp
(
chop
(
fgets
(
$fp
)),
'y'
)
==
0
)
{
system_halt
(
true
);
system_halt
(
true
);
...
...
src/etc/rc.initial.reboot
View file @
e34cce34
...
@@ -33,7 +33,7 @@ require_once("system.inc");
...
@@ -33,7 +33,7 @@ require_once("system.inc");
$fp
=
fopen
(
'php://stdin'
,
'r'
);
$fp
=
fopen
(
'php://stdin'
,
'r'
);
echo
"The system will reboot. Do you want to proceed [y|n]? "
;
echo
'The system will reboot. Do you want to proceed? [y/N]: '
;
if
(
strcasecmp
(
chop
(
fgets
(
$fp
)),
'y'
)
==
0
)
{
if
(
strcasecmp
(
chop
(
fgets
(
$fp
)),
'y'
)
==
0
)
{
system_reboot
(
true
);
system_reboot
(
true
);
...
...
src/etc/rc.initial.restore
View file @
e34cce34
...
@@ -69,7 +69,7 @@ function restore_history_backup($number)
...
@@ -69,7 +69,7 @@ function restore_history_backup($number)
list_backups
(
$number
);
list_backups
(
$number
);
$filename
=
array_keys
(
$confvers
)[
$number
-
1
];
$filename
=
array_keys
(
$confvers
)[
$number
-
1
];
$thisbackup
=
$confvers
[
$filename
];
$thisbackup
=
$confvers
[
$filename
];
echo
'
Y/N?
: '
;
echo
'
[y/N]
: '
;
$confirm
=
strtoupper
(
chop
(
fgets
(
$fp
)));
$confirm
=
strtoupper
(
chop
(
fgets
(
$fp
)));
if
(
$confirm
==
'Y'
)
{
if
(
$confirm
==
'Y'
)
{
$cnf
=
OPNsense\Core\Config
::
getInstance
();
$cnf
=
OPNsense\Core\Config
::
getInstance
();
...
...
src/etc/rc.initial.setports
View file @
e34cce34
...
@@ -39,9 +39,6 @@ require_once("interfaces.inc");
...
@@ -39,9 +39,6 @@ require_once("interfaces.inc");
system_console_mute
();
system_console_mute
();
if
(
set_networking_interfaces_ports
())
{
if
(
set_networking_interfaces_ports
())
{
global
$config
;
$config
=
parse_config
(
true
);
/* need to stop local dhcp servers to avoid wrong leases */
/* need to stop local dhcp servers to avoid wrong leases */
killbypid
(
'/var/dhcpd/var/run/dhcpd.pid'
,
'TERM'
,
true
);
killbypid
(
'/var/dhcpd/var/run/dhcpd.pid'
,
'TERM'
,
true
);
killbypid
(
'/var/dhcpd/var/run/dhcpdv6.pid'
,
'TERM'
,
true
);
killbypid
(
'/var/dhcpd/var/run/dhcpdv6.pid'
,
'TERM'
,
true
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment