Commit bf8356c9 authored by Franco Fichtner's avatar Franco Fichtner

rc.initial: apply PSR2 style

parent 0fe885b9
......@@ -48,13 +48,13 @@ if (empty($iflist)) {
return;
}
foreach($iflist as $ifname => $friendly) {
foreach ($iflist as $ifname => $friendly) {
/* point to this interface's config */
$ifconf = $config['interfaces'][$ifname];
/* look for 'special cases' */
$class = "";
if (isset($ifconf['ipaddr'])) {
switch($ifconf['ipaddr']) {
switch ($ifconf['ipaddr']) {
case "dhcp":
$class = "/DHCP4";
break;
......@@ -71,7 +71,7 @@ foreach($iflist as $ifname => $friendly) {
}
$class6 = null;
if (isset($ifconf['ipaddrv6'])) {
switch($ifconf['ipaddrv6']) {
switch ($ifconf['ipaddrv6']) {
case "dhcp6":
$class6 = "/DHCP6";
break;
......@@ -100,7 +100,8 @@ foreach($iflist as $ifname => $friendly) {
$v6first = false;
if (!empty($ipaddr) && !empty($subnet)) {
printf("v4%s: %s/%s",
printf(
"v4%s: %s/%s",
$class,
$ipaddr,
$subnet
......@@ -112,7 +113,8 @@ foreach($iflist as $ifname => $friendly) {
if (!$v6first) {
printf("\n%s", str_repeat(" ", 20));
}
printf("v6%s: %s/%s",
printf(
"v6%s: %s/%s",
$class6,
$ipaddr6,
$subnet6
......
......@@ -56,8 +56,9 @@ if (strcasecmp(chop(fgets($fp)), 'y') == 0) {
echo "Failed to locate the admin user account! Attempting to restore access.\n";
$admin_user = array();
$admin_user['uid'] = 0;
if (!isset($config['system']['user']))
if (!isset($config['system']['user'])) {
$config['system']['user'] = array();
}
$config['system']['user'][] = $admin_user;
}
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment