Commit 8121fffd authored by Franco Fichtner's avatar Franco Fichtner

rc: improve the user experience on boot

First impressions are the most important ones...
parent 3606a039
...@@ -152,7 +152,7 @@ ...@@ -152,7 +152,7 @@
</sysctl> </sysctl>
<system> <system>
<optimization>normal</optimization> <optimization>normal</optimization>
<hostname>pfSense</hostname> <hostname>OPNsense</hostname>
<domain>localdomain</domain> <domain>localdomain</domain>
<dnsserver/> <dnsserver/>
<dnsallowoverride/> <dnsallowoverride/>
......
<?php
/*
external config loader
Copyright (C) 2010 Scott Ullrich
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Currently supported file system types: MS-Dos, FreeBSD UFS
*/
require_once("globals.inc");
require_once("functions.inc");
require_once("config.lib.inc");
require_once("config.inc");
$debug = false;
function get_boot_disk() {
global $g, $debug;
$disk = exec("/sbin/mount | /usr/bin/grep \"on / \" | /usr/bin/cut -d'/' -f3 | /usr/bin/cut -d' ' -f1");
return $disk;
}
function get_swap_disks() {
exec("/usr/sbin/swapinfo | /usr/bin/sed '/^\/dev/!d; s,^/dev/,,; s, .*\$,,'", $disks);
return $disks;
}
function get_disk_slices($disk) {
global $g, $debug;
$slices_array = array();
$slices = trim(exec("/bin/ls " . escapeshellarg("/dev/" . $disk . "s*") . " 2>/dev/null"));
$slices = str_replace("/dev/", "", $slices);
if($slices == "ls: No match.")
return;
$slices_array = explode(" ", $slices);
return $slices_array;
}
function get_disks() {
global $g, $debug;
$disks_array = array();
$disks_s = explode(" ", get_single_sysctl("kern.disks"));
foreach($disks_s as $disk)
if(trim($disk))
$disks_array[] = $disk;
return $disks_array;
}
function discover_config($mountpoint) {
global $g, $debug;
$locations_to_check = array("/", "/config");
foreach($locations_to_check as $ltc) {
$tocheck = "/tmp/mnt/cf{$ltc}config.xml";
if($debug) {
echo "\nChecking for $tocheck";
if(file_exists($tocheck))
echo " -> found!";
}
if(file_exists($tocheck))
return $tocheck;
}
return "";
}
function test_config($file_location) {
global $g, $debug;
if(!$file_location)
return;
// config.xml was found. ensure it is sound.
$root_obj = trim("<{$g['xml_rootobj']}>");
$xml_file_head = exec("/usr/bin/head -2 " . escapeshellarg($file_location) . " | /usr/bin/tail -n1");
if($debug) {
echo "\nroot obj = $root_obj";
echo "\nfile head = $xml_file_head";
}
if($xml_file_head == $root_obj) {
// Now parse config to make sure
$config_status = config_validate($file_location);
if($config_status)
return true;
}
return false;
}
// Probes all disks looking for config.xml
function find_config_xml() {
global $g, $debug;
$disks = get_disks();
// Safety check.
if(!is_array($disks))
return;
$boot_disk = get_boot_disk();
$swap_disks = get_swap_disks();
exec("/bin/mkdir -p /tmp/mnt/cf");
foreach($disks as $disk) {
$slices = get_disk_slices($disk);
if(is_array($slices)) {
foreach($slices as $slice) {
if($slice == "")
continue;
if(stristr($slice, $boot_disk)) {
if($debug)
echo "\nSkipping boot device slice $slice";
continue;
}
if(in_array($slice, $swap_disks)) {
if($debug)
echo "\nSkipping swap device slice $slice";
continue;
}
echo " $slice";
// First try msdos fs
if($debug)
echo "\n/sbin/mount -t msdosfs /dev/{$slice} /tmp/mnt/cf 2>/dev/null \n";
$result = exec("/sbin/mount -t msdosfs /dev/{$slice} /tmp/mnt/cf 2>/dev/null");
// Next try regular fs (ufs)
if(!$result) {
if($debug)
echo "\n/sbin/mount /dev/{$slice} /tmp/mnt/cf 2>/dev/null \n";
$result = exec("/sbin/mount /dev/{$slice} /tmp/mnt/cf 2>/dev/null");
}
$mounted = trim(exec("/sbin/mount | /usr/bin/grep -v grep | /usr/bin/grep '/tmp/mnt/cf' | /usr/bin/wc -l"));
if($debug)
echo "\nmounted: $mounted ";
if(intval($mounted) > 0) {
// Item was mounted - look for config.xml file
$config_location = discover_config($slice);
if($config_location) {
if(test_config($config_location)) {
// We have a valid configuration. Install it.
echo " -> found config.xml\n";
echo "Backing up old configuration...\n";
backup_config();
echo "Restoring [{$slice}] {$config_location}...\n";
restore_backup($config_location);
echo "Cleaning up...\n";
exec("/sbin/umount /tmp/mnt/cf");
exit;
}
}
exec("/sbin/umount /tmp/mnt/cf");
}
}
}
}
}
echo "External config loader 1.0 is now starting...";
find_config_xml();
echo "\n";
?>
...@@ -63,7 +63,6 @@ $g = array( ...@@ -63,7 +63,6 @@ $g = array(
"product_website" => "www.opnsense.org", "product_website" => "www.opnsense.org",
"product_website_footer" => "https://www.opnsense.org/?gui22", "product_website_footer" => "https://www.opnsense.org/?gui22",
"product_email" => "coreteam@opnsense.org", "product_email" => "coreteam@opnsense.org",
"hideplatform" => false,
"hidedownloadbackup" => false, "hidedownloadbackup" => false,
"hidebackupbeforeupgrade" => false, "hidebackupbeforeupgrade" => false,
"disablethemeselection" => false, "disablethemeselection" => false,
......
#!/bin/sh #!/bin/sh
# part of pfSense by Scott Ullrich
# Copyright (C) 2004-2010 Scott Ullrich, All rights reserved. # Copyright (C) 2004-2010 Scott Ullrich, All rights reserved.
# originally based on m0n0wall (http://neon1.net/m0n0wall)
# Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>. # Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
# Copyright (C) 2014 Franco Fichtner <franco@opnsense.org>
# All rights reserved. # All rights reserved.
stty status '^T' 2> /dev/null stty status '^T' 2> /dev/null
...@@ -18,18 +17,15 @@ HOME=/ ...@@ -18,18 +17,15 @@ HOME=/
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin
export HOME PATH export HOME PATH
# Set our operating platform
PLATFORM=`/bin/cat /usr/local/etc/platform` PLATFORM=`/bin/cat /usr/local/etc/platform`
# Set our current version
version=`/bin/cat /usr/local/etc/version`
if [ -e /root/force_fsck ]; then if [ -e /root/force_fsck ]; then
echo "Forcing filesystem check..." echo "Forcing filesystem check..."
/sbin/fsck -y -t ufs / /sbin/fsck -y -t ufs /
if [ "$PLATFORM" = "nanobsd" ]; then if [ "$PLATFORM" = "nanobsd" ]; then
/sbin/fsck -y -t ufs /cf /sbin/fsck -y -t ufs /cf
fi fi
/bin/rm -f /root/force_fsck
fi fi
if [ "${PLATFORM}" = "nanobsd" ]; then if [ "${PLATFORM}" = "nanobsd" ]; then
...@@ -150,10 +146,6 @@ if [ ! -f /conf/config.xml ]; then ...@@ -150,10 +146,6 @@ if [ ! -f /conf/config.xml ]; then
echo " done." echo " done."
fi fi
/bin/rm -f /root/force_fsck
/bin/rm -f /root/TRIM_set
/bin/rm -f /root/TRIM_unset
# Disable APM on ATA drives. Leaving this on will kill drives long-term, especially laptop drives, by generating excessive Load Cycles. # Disable APM on ATA drives. Leaving this on will kill drives long-term, especially laptop drives, by generating excessive Load Cycles.
if [ -f /usr/local/etc/rc.disable_hdd_apm ]; then if [ -f /usr/local/etc/rc.disable_hdd_apm ]; then
/usr/local/etc/rc.disable_hdd_apm /usr/local/etc/rc.disable_hdd_apm
...@@ -170,24 +162,10 @@ fi ...@@ -170,24 +162,10 @@ fi
rm -f /etc/spwd.db.tmp rm -f /etc/spwd.db.tmp
/usr/sbin/pwd_mkdb -d /etc/ /etc/master.passwd /usr/sbin/pwd_mkdb -d /etc/ /etc/master.passwd
product=`/usr/bin/grep product_name /usr/local/etc/inc/globals.inc | /usr/bin/cut -d'"' -f4`
hideplatform=`/usr/bin/grep hideplatform /usr/local/etc/inc/globals.inc | /usr/bin/wc -l`
varrunpath=`/usr/bin/grep varrun_path /usr/local/etc/inc/globals.inc | /usr/bin/cut -d'"' -f4`
if [ "$PLATFORM" = "pfSense" ] && [ ${USE_MFS_TMPVAR} -eq 0 ]; then if [ "$PLATFORM" = "pfSense" ] && [ ${USE_MFS_TMPVAR} -eq 0 ]; then
/sbin/mdmfs -S -M -s 4m md $varrunpath /sbin/mdmfs -S -M -s 4m md /var/run
fi
if [ "$hideplatform" -gt "0" ]; then
platformbanner="" # hide the platform
else
platformbanner=" on the '${PLATFORM}' platform"
fi fi
echo
echo "Welcome to ${product} ${version} ${platformbanner} ..."
echo
if [ ! "$PLATFORM" = "jail" ]; then if [ ! "$PLATFORM" = "jail" ]; then
# Enable console output if its muted. # Enable console output if its muted.
/sbin/conscontrol mute off >/dev/null /sbin/conscontrol mute off >/dev/null
...@@ -207,7 +185,6 @@ elif [ "$PLATFORM" = "nanobsd" ] || [ ${USE_MFS_TMPVAR} -gt 0 ]; then ...@@ -207,7 +185,6 @@ elif [ "$PLATFORM" = "nanobsd" ] || [ ${USE_MFS_TMPVAR} -gt 0 ]; then
elif [ "$PLATFORM" = "jail" ]; then elif [ "$PLATFORM" = "jail" ]; then
# do nothing for jail platform # do nothing for jail platform
else else
SWAPDEVICE=`/bin/cat /etc/fstab | /usr/bin/grep swap | /usr/bin/cut -f1`
/sbin/swapon -a /sbin/swapon -a
/usr/local/etc/rc.savecore /usr/local/etc/rc.savecore
...@@ -220,17 +197,9 @@ else ...@@ -220,17 +197,9 @@ else
fi fi
fi fi
# Copy PBI keys
if ls /usr/local/share/pbi-keys/*.ssl >/dev/null 2>&1; then
if [ ! -d "/var/db/pbi/keys" ]; then
mkdir -p /var/db/pbi/keys
fi
cp -f /usr/local/share/pbi-keys/*.ssl /var/db/pbi/keys
fi
# make some directories in /var # make some directories in /var
/bin/mkdir -p $varrunpath /var/log /var/etc /var/db/entropy /var/at/jobs/ /var/empty 2>/dev/null /bin/mkdir -p /var/run /var/log /var/etc /var/db/entropy /var/at/jobs/ /var/empty 2>/dev/null
/bin/rm -rf $varrunpath/* /bin/rm -rf /var/run/*
if [ "$PLATFORM" != "pfSense" ]; then if [ "$PLATFORM" != "pfSense" ]; then
/bin/rm /var/log/* 2>/dev/null /bin/rm /var/log/* 2>/dev/null
fi fi
...@@ -278,10 +247,7 @@ if [ ! -h /tmp/tmp ]; then ...@@ -278,10 +247,7 @@ if [ ! -h /tmp/tmp ]; then
/bin/ln -hfs / /tmp/tmp /bin/ln -hfs / /tmp/tmp
fi fi
# Make sure our /tmp is 777 + Sticky /bin/rm -rf /tmp/*
if [ ! "$PLATFORM" = "cdrom" ] ; then
/bin/rm -rf /tmp/*
fi
/bin/chmod 1777 /tmp /bin/chmod 1777 /tmp
if [ ! "$PLATFORM" = "cdrom" ] ; then if [ ! "$PLATFORM" = "cdrom" ] ; then
...@@ -351,7 +317,7 @@ if [ ! "$PLATFORM" = "jail" ]; then ...@@ -351,7 +317,7 @@ if [ ! "$PLATFORM" = "jail" ]; then
fi fi
# Create an initial utmp file # Create an initial utmp file
cd $varrunpath && /bin/cp /dev/null utmp && /bin/chmod 644 utmp cd /var/run && /bin/cp /dev/null utmp && /bin/chmod 644 utmp
echo -n "." echo -n "."
/sbin/ldconfig -elf /usr/lib /usr/local/lib /lib /sbin/ldconfig -elf /usr/lib /usr/local/lib /lib
...@@ -378,14 +344,8 @@ echo "done." ...@@ -378,14 +344,8 @@ echo "done."
# Recreate capabilities DB # Recreate capabilities DB
/usr/bin/cap_mkdb /etc/login.conf /usr/bin/cap_mkdb /etc/login.conf
# Run the php.ini setup file and populate # Run the php.ini setup file
# /usr/local/etc/php.ini and /usr/local/lib/php.ini /usr/local/etc/rc.php_ini_setup
/usr/local/etc/rc.php_ini_setup 2>/tmp/php_errors.txt
# Launch external configuration loader for supported platforms
if [ "$PLATFORM" = "nanobsd" -o "$PLATFORM" = "pfSense" ]; then
/usr/local/bin/php -q /usr/local/etc/ecl.php
fi
chmod u+rx /usr/local/opnsense/service/check_reload_status.py chmod u+rx /usr/local/opnsense/service/check_reload_status.py
/usr/bin/nice -n20 /usr/local/opnsense/service/check_reload_status.py /usr/bin/nice -n20 /usr/local/opnsense/service/check_reload_status.py
...@@ -395,11 +355,11 @@ sleep 1 # give check_reload_status some time to load to prevent missing socket ...@@ -395,11 +355,11 @@ sleep 1 # give check_reload_status some time to load to prevent missing socket
echo -n "Launching the init system..." echo -n "Launching the init system..."
/bin/rm -f /cf/conf/backup/backup.cache /bin/rm -f /cf/conf/backup/backup.cache
/bin/rm -f /root/lighttpd* /bin/rm -f /root/lighttpd*
/usr/bin/touch $varrunpath/booting /usr/bin/touch /var/run/booting
/usr/local/etc/rc.bootup /usr/local/etc/rc.bootup
# rc.bootup unset $g['booting'], remove file right now to be consistent # rc.bootup unset $g['booting'], remove file right now to be consistent
/bin/rm $varrunpath/booting /bin/rm /var/run/booting
# If a shell was selected from recovery # If a shell was selected from recovery
# console then just drop to the shell now. # console then just drop to the shell now.
...@@ -412,16 +372,14 @@ echo -n "Starting CRON... " ...@@ -412,16 +372,14 @@ echo -n "Starting CRON... "
cd /tmp && /usr/sbin/cron -s 2>/dev/null cd /tmp && /usr/sbin/cron -s 2>/dev/null
echo "done." echo "done."
/bin/rm -rf /usr/local/pkg/pf/CVS
# Start ping handler every 240 seconds # Start ping handler every 240 seconds
/usr/local/bin/minicron 240 $varrunpath/ping_hosts.pid /usr/local/bin/ping_hosts.sh /usr/local/bin/minicron 240 /var/run/ping_hosts.pid /usr/local/bin/ping_hosts.sh
# Start account expire handler every hour # Start account expire handler every hour
/usr/local/bin/minicron 3600 $varrunpath/expire_accounts.pid /usr/local/etc/rc.expireaccounts /usr/local/bin/minicron 3600 /var/run/expire_accounts.pid /usr/local/etc/rc.expireaccounts
# Start alias url updater every 24 hours # Start alias url updater every 24 hours
/usr/local/bin/minicron 86400 $varrunpath/update_alias_url_data.pid /usr/local/etc/rc.update_alias_url_data /usr/local/bin/minicron 86400 /var/run/update_alias_url_data.pid /usr/local/etc/rc.update_alias_url_data
/bin/chmod a+rw /tmp/. /bin/chmod a+rw /tmp/.
...@@ -434,15 +392,13 @@ if [ "${GMIRROR_STATUS}" != "" ]; then ...@@ -434,15 +392,13 @@ if [ "${GMIRROR_STATUS}" != "" ]; then
/usr/local/bin/minicron 60 /var/run/gmirror_status_check.pid /usr/local/sbin/gmirror_status_check.php /usr/local/bin/minicron 60 /var/run/gmirror_status_check.pid /usr/local/sbin/gmirror_status_check.php
fi fi
# Log product version to syslog
ARCH=`uname -m`
echo "$product ($PLATFORM) $version $ARCH"
echo "Bootup complete"
/usr/local/bin/beep.sh start 2>&1 >/dev/null /usr/local/bin/beep.sh start 2>&1 >/dev/null
# Reset the cache. read-only requires this. # Reset the cache. read-only requires this.
/bin/rm -f /tmp/config.cache /bin/rm -f /tmp/config.cache
echo
/usr/local/etc/rc.initial.banner
exit 0 exit 0
...@@ -35,15 +35,7 @@ fi ...@@ -35,15 +35,7 @@ fi
# endless loop # endless loop
while : ; do while : ; do
if [ -f /tmp/ttybug ]; then
rm /tmp/ttybug
exit && exit && logout
fi
/usr/local/etc/rc.banner
product=`grep product_name /usr/local/etc/inc/globals.inc | cut -d'"' -f4` product=`grep product_name /usr/local/etc/inc/globals.inc | cut -d'"' -f4`
hidebanner=`grep hidebanner /usr/local/etc/inc/globals.inc | cut -d'"' -f4`
# Check to see if SSH is running. # Check to see if SSH is running.
if pgrep -q -a -F /var/run/sshd.pid sshd >/dev/null 2>&1; then if pgrep -q -a -F /var/run/sshd.pid sshd >/dev/null 2>&1; then
...@@ -52,20 +44,12 @@ else ...@@ -52,20 +44,12 @@ else
sshd_option="14) Enable Secure Shell (sshd)"; sshd_option="14) Enable Secure Shell (sshd)";
fi fi
for i in /var/db/pfi/capable_*; do
if [ -f $i -a ! -L /cf/conf ]; then
option98="98) Move configuration file to removable device"
break
fi
done
if [ "$PLATFORM" = "cdrom" ]; then if [ "$PLATFORM" = "cdrom" ]; then
option99="99) Install ${product} to a hard drive, etc." option99="99) Install ${product} to a hard drive, etc."
fi fi
# display a cheap menu # display a cheap menu
echo "" echo " 0) Logout 8) Shell"
echo " 0) Logout (SSH only) 8) Shell"
echo " 1) Assign Interfaces 9) pfTop" echo " 1) Assign Interfaces 9) pfTop"
echo " 2) Set interface(s) IP address 10) Filter Logs" echo " 2) Set interface(s) IP address 10) Filter Logs"
echo " 3) Reset webConfigurator password 11) Restart webConfigurator" echo " 3) Reset webConfigurator password 11) Restart webConfigurator"
...@@ -73,8 +57,6 @@ echo " 4) Reset to factory defaults 12) ${product} Developer Shell" ...@@ -73,8 +57,6 @@ echo " 4) Reset to factory defaults 12) ${product} Developer Shell"
echo " 5) Reboot system 13) Upgrade from console" echo " 5) Reboot system 13) Upgrade from console"
echo " 6) Halt system ${sshd_option}" echo " 6) Halt system ${sshd_option}"
echo " 7) Ping host 15) Restore recent configuration" echo " 7) Ping host 15) Restore recent configuration"
echo " ${option98} "
if [ "${option99}" != "" ]; then if [ "${option99}" != "" ]; then
/bin/echo "${option99}" /bin/echo "${option99}"
fi fi
...@@ -86,7 +68,7 @@ echo ...@@ -86,7 +68,7 @@ echo
# see what the user has chosen # see what the user has chosen
case ${opmode} in case ${opmode} in
0) 0)
logout exit
;; ;;
1) 1)
/usr/local/etc/rc.initial.setports /usr/local/etc/rc.initial.setports
...@@ -144,5 +126,8 @@ case ${opmode} in ...@@ -144,5 +126,8 @@ case ${opmode} in
;; ;;
esac esac
done /usr/local/etc/rc.initial.banner
echo
done
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
<?php <?php
/* /*
part of pfSense
Copyright (C) 2005 Scott Ullrich and Colin Smith Copyright (C) 2005 Scott Ullrich and Colin Smith
Copyright (C) 2009 Ermal Luçi Copyright (C) 2009 Ermal Luçi
All rights reserved All rights reserved
...@@ -29,25 +28,20 @@ ...@@ -29,25 +28,20 @@
POSSIBILITY OF SUCH DAMAGE. POSSIBILITY OF SUCH DAMAGE.
*/ */
/* parse the configuration and include all functions used below */ /* parse the configuration and include all functions used below */
require_once("config.inc"); require_once("config.inc");
require_once("gwlb.inc"); require_once("gwlb.inc");
require_once("interfaces.inc"); require_once("interfaces.inc");
$version = trim(file_get_contents("/usr/local/etc/version")); $version = trim(file_get_contents("/usr/local/etc/version"));
$platform = trim(file_get_contents("/usr/local/etc/platform")); $hostname = $config['system']['hostname'];
$hostname = $config['system']['hostname']; $product = $g['product_name'];
$product = $g['product_name']; $machine = trim(`uname -m`);
$machine = trim(`uname -m`);
$hideplatform = $g['hideplatform'];
if(!$hideplatform) print "*** Welcome to {$product} {$version} ({$machine}) on {$hostname} ***\n";
$platformbanner = "-{$platform}";
print "*** Welcome to {$product} {$version}{$platformbanner} ({$machine}) on {$hostname} ***\n"; $iflist = get_configured_interface_with_descr(false, true);
foreach($iflist as $ifname => $friendly) {
$iflist = get_configured_interface_with_descr(false, true);
foreach($iflist as $ifname => $friendly) {
/* point to this interface's config */ /* point to this interface's config */
$ifconf = $config['interfaces'][$ifname]; $ifconf = $config['interfaces'][$ifname];
/* look for 'special cases' */ /* look for 'special cases' */
...@@ -90,12 +84,10 @@ ...@@ -90,12 +84,10 @@
$ipaddr6 = get_interface_ipv6($ifname); $ipaddr6 = get_interface_ipv6($ifname);
$subnet6 = get_interface_subnetv6($ifname); $subnet6 = get_interface_subnetv6($ifname);
$realif = get_real_interface($ifname); $realif = get_real_interface($ifname);
$tobanner = "{$friendly} ({$ifname})"; $tobanner = "{$friendly} ({$realif})";
printf("\n %-15s -> ", $tobanner);
printf("\n %-15s -> %-10s -> ",
$tobanner,
$realif
);
$v6first = false; $v6first = false;
if (!empty($ipaddr) && !empty($subnet)) { if (!empty($ipaddr) && !empty($subnet)) {
printf("v4%s: %s/%s", printf("v4%s: %s/%s",
...@@ -108,7 +100,7 @@ ...@@ -108,7 +100,7 @@
} }
if (!empty($ipaddr6) && !empty($subnet6)) { if (!empty($ipaddr6) && !empty($subnet6)) {
if (!$v6first) { if (!$v6first) {
printf("\n%s", str_repeat(" ",34)); printf("\n%s", str_repeat(" ", 20));
} }
printf("v6%s: %s/%s", printf("v6%s: %s/%s",
$class6, $class6,
...@@ -116,6 +108,6 @@ ...@@ -116,6 +108,6 @@
$subnet6 $subnet6
); );
} }
} }
?> printf("\n");
...@@ -135,7 +135,6 @@ $filesystems = get_mounted_filesystems(); ...@@ -135,7 +135,6 @@ $filesystems = get_mounted_filesystems();
<?php endif; ?> <?php endif; ?>
</td> </td>
</tr> </tr>
<?php if(!$g['hideplatform']): ?>
<tr> <tr>
<td width="25%" class="vncellt"><?=gettext("Platform");?></td> <td width="25%" class="vncellt"><?=gettext("Platform");?></td>
<td width="75%" class="listr"> <td width="75%" class="listr">
...@@ -145,7 +144,6 @@ $filesystems = get_mounted_filesystems(); ...@@ -145,7 +144,6 @@ $filesystems = get_mounted_filesystems();
} ?> } ?>
</td> </td>
</tr> </tr>
<?php endif; ?>
<?php if ($g['platform'] == "nanobsd"): ?> <?php if ($g['platform'] == "nanobsd"): ?>
<? <?
global $SLICE, $OLDSLICE, $TOFLASH, $COMPLETE_PATH, $COMPLETE_BOOT_PATH; global $SLICE, $OLDSLICE, $TOFLASH, $COMPLETE_PATH, $COMPLETE_BOOT_PATH;
......
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