interfaces: remove the PPP uptime option

Was modified in 4d495ea6cc, f129c4682b et al. to a state where
the option could still be enabled but never read.  The /conf bound historic
log is still filled but nothing reads it.  Let's retire it for 27.1.

One other goal here is to reduce the incoming impact of a MVC/API rewrite.

Discussed with: @swhite2
This commit is contained in:
Franco Fichtner
2026-10-09 13:06:43 +02:00
parent 5aaddb855c
commit 3e63c1cbf8
6 changed files with 1 additions and 34 deletions
-1
View File
@@ -1331,7 +1331,6 @@
/usr/local/opnsense/scripts/interfaces/ppp-linkdown.sh
/usr/local/opnsense/scripts/interfaces/ppp-linkup.sh
/usr/local/opnsense/scripts/interfaces/ppp-rename.sh
/usr/local/opnsense/scripts/interfaces/ppp-uptime.sh
/usr/local/opnsense/scripts/interfaces/reconfigure_bridges.php
/usr/local/opnsense/scripts/interfaces/reconfigure_gifs.php
/usr/local/opnsense/scripts/interfaces/reconfigure_gres.php
-7
View File
@@ -1357,13 +1357,6 @@ EOD;
/* write the configuration */
@file_put_contents("/var/etc/mpd_{$interface}.conf", $mpdconf);
/* create the uptime log if requested */
if (isset($ppp['uptime'])) {
@touch("/conf/{$ifcfg['if']}.log");
} else {
@unlink("/conf/{$ifcfg['if']}.log");
}
/* clean up old lock files */
foreach ($ports as $port) {
@unlink('/var/spool/lock/LCK..' . basename($port));
@@ -25,11 +25,4 @@ elif [ "${AF}" = "inet6" ]; then
/usr/local/sbin/configctl -d interface newipv6 ${IF}
fi
UPTIME=$(/usr/local/opnsense/scripts/interfaces/ppp-uptime.sh ${IF})
if [ -n "${UPTIME}" -a -f "/conf/${IF}.log" ]; then
echo $(date -j +%Y.%m.%d-%H:%M:%S) ${UPTIME} >> /conf/${IF}.log
fi
rm -f /tmp/${IF}_uptime
exit 0
@@ -37,6 +37,4 @@ elif [ "${AF}" = "inet6" ]; then
fi
fi
touch /tmp/${IF}_uptime
exit 0
@@ -1,5 +0,0 @@
#!/bin/sh
if [ -f /tmp/${1}_uptime ]; then
echo $(($(date -j +%s) - $(/usr/bin/stat -f %m /tmp/${1}_uptime)))
fi
+1 -12
View File
@@ -101,7 +101,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$id = $_GET['id'];
}
// plain 1-on-1 copy
$copy_fields = array('ptpid', 'type', 'username', 'idletimeout', 'uptime', 'descr', 'simpin', 'pin-wait',
$copy_fields = array('ptpid', 'type', 'username', 'idletimeout', 'descr', 'simpin', 'pin-wait',
'apn', 'apnum', 'phone', 'connect-timeout', 'provider', 'hostuniq');
foreach ($copy_fields as $fieldname) {
if (isset($a_ppps[$id][$fieldname])) {
@@ -220,7 +220,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
if (!empty($pconfig['idletimeout'])) {
$ppp['idletimeout'] = $pconfig['idletimeout'];
}
$ppp['uptime'] = !empty($pconfig['uptime']);
if (!empty($pconfig['descr'])) {
$ppp['descr'] = $pconfig['descr'];
}
@@ -713,16 +712,6 @@ include("head.inc");
</div>
</td>
</tr>
<tr style="display:none" class="act_show_advanced">
<td><a id="help_for_uptime" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?= gettext("Uptime Logging"); ?></td>
<td>
<input type="checkbox" value="on" id="uptime" name="uptime" <?=!empty($pconfig['uptime']) ? "checked=\"checked\"" : ""; ?> />
<?= gettext("Enable persistent logging of connection uptime."); ?>
<div class="hidden" data-for="help_for_uptime">
<?= gettext("This option causes cumulative uptime to be recorded and displayed on the Status Interfaces page."); ?>
</div>
</td>
</tr>
</tbody>
</table>
<!-- Advanced (all) -->