diff --git a/doc/wrs-user-manual.in b/doc/wrs-user-manual.in index f09638cb9863145c0984fd1fa83e9397fed16c88..4cfef92b01bbf9644eaa52a9f7888beac694300c 100644 --- a/doc/wrs-user-manual.in +++ b/doc/wrs-user-manual.in @@ -935,7 +935,7 @@ in @ref{wrs_vlans}. In addition to that, to have synchronization working with VLANs, you have to prepare a custom @i{PPSi} configuration file with VLANs specified per-port. You can simply copy the file generated in the WRS filesystem -(@i{/wr/etc/ppsi.conf}) to a central @t{tftp}/@t{http}/@t{ftp} server where +(@i{/etc/ppsi.conf}) to a central @t{tftp}/@t{http}/@t{ftp} server where @i{dot-config} files for your switches are stored and fetched on boot time. For every VLAN-enabled port you should add the following line: @example diff --git a/userspace/rootfs_override/var/www/functions.php b/userspace/rootfs_override/var/www/functions.php index b659b47c45c1f830927e14f44bd57b74ea594f81..56b853c806454239a219e00b972d0f54f75c5d10 100644 --- a/userspace/rootfs_override/var/www/functions.php +++ b/userspace/rootfs_override/var/www/functions.php @@ -3,7 +3,7 @@ //Global Variables $etcdir="/usr/wr/etc/"; //configuration file folder for WRS $snmpconf="snmpd.conf"; -$ppsiconf="ppsi-pre.conf"; +$ppsipreconf="ppsi-pre.conf"; $sfpdatabaseconf="sfp_database.conf"; $wrdateconf="wr_date.conf"; $vlancolor = array("#27DE2A", "#B642A8", "#6E42B6", "#425DB6" , "#428DB6", "#4686B6", "#43B88B", "#42B65F", "#82B642", "#B6AE42", "#B67E42"); @@ -883,16 +883,16 @@ function wrs_ptp_configuration(){ header('Location: ptp.php'); } if (!empty($_POST["clkclass"])){ - $old_value= rtrim(shell_exec("cat ".$GLOBALS['etcdir'].$GLOBALS['ppsiconf']." | grep class ")); + $old_value= rtrim(shell_exec("cat ".$GLOBALS['etcdir'].$GLOBALS['ppsipreconf']." | grep class ")); $new_value="clock-class ".htmlspecialchars($_POST["clkclass"]); - $sed = 'sed -i "s/'.$old_value.'/'.$new_value.'/g" '.$GLOBALS['etcdir'].$GLOBALS['ppsiconf'];echo $sed; + $sed = 'sed -i "s/'.$old_value.'/'.$new_value.'/g" '.$GLOBALS['etcdir'].$GLOBALS['ppsipreconf'];echo $sed; shell_exec($sed); echo '<br>Clock Class changed to '.htmlspecialchars($_POST["clkclass"]); } if (!empty($_POST["clkacc"])){ - $old_value= rtrim(shell_exec("cat ".$GLOBALS['etcdir'].$GLOBALS['ppsiconf']." | grep accuracy ")); + $old_value= rtrim(shell_exec("cat ".$GLOBALS['etcdir'].$GLOBALS['ppsipreconf']." | grep accuracy ")); $new_value="clock-accuracy ".htmlspecialchars($_POST["clkacc"]); - $sed ='sed -i "s/'.$old_value.'/'.$new_value.'/g" '.$GLOBALS['etcdir'].$GLOBALS['ppsiconf'];echo $sed; + $sed ='sed -i "s/'.$old_value.'/'.$new_value.'/g" '.$GLOBALS['etcdir'].$GLOBALS['ppsipreconf'];echo $sed; shell_exec($sed); echo '<br>Clock Accuracy changed to '.htmlspecialchars($_POST["clkacc"]); } diff --git a/userspace/rootfs_override/var/www/ptp.php b/userspace/rootfs_override/var/www/ptp.php index 5293863933d51cd795d830fcb2932f47e378bd14..f3a72a95a6206b9c541142ae163abcf8b66b7cba 100644 --- a/userspace/rootfs_override/var/www/ptp.php +++ b/userspace/rootfs_override/var/www/ptp.php @@ -84,6 +84,7 @@ $section = "WRS_FORMS"; $subsection = "CONFIG_PPSI"; + wrs_ptp_configuration(); $_SESSION["WRS_FORMS"]["CONFIG_PPSI"][CONFIG_PPSI_00]["value"]= shell_exec("cat /wr/etc/ppsi-pre.conf | grep clock-class | awk '{print $2}'"); $_SESSION["WRS_FORMS"]["CONFIG_PPSI"][CONFIG_PPSI_01]["value"]= @@ -91,7 +92,6 @@ print_form($section, $subsection, $formatID, $class, $infoname, $format); - wrs_ptp_configuration(); wrs_management(); if ((!empty($_POST["modegroup"]))){ diff --git a/userspace/rootfs_override/wr/bin/apply_dot-config b/userspace/rootfs_override/wr/bin/apply_dot-config index 5e00f0a251a1ddb9d334df08544109c8cc627942..f9ed4de37bf5cc81a3e38e0cf438b233d9b87b82 100755 --- a/userspace/rootfs_override/wr/bin/apply_dot-config +++ b/userspace/rootfs_override/wr/bin/apply_dot-config @@ -108,7 +108,7 @@ copy_conf /wr/etc/snmpd.conf if [ "$CONFIG_PTP_PORT_PARAMS" = "y" ]; then /wr/bin/assembly_ppsi_conf.sh elif [ "$CONFIG_PTP_CUSTOM" = "y" ]; then - cp "$CONFIG_PTP_CUSTOM_FILENAME" /wr/etc/ppsi.conf + cp "$CONFIG_PTP_CUSTOM_FILENAME" /etc/ppsi.conf elif [ "$CONFIG_PTP_REMOTE_CONF" = "y" ]; then # Warning: code below copied from /etc/init.d/dot-config. @@ -144,14 +144,10 @@ elif [ "$CONFIG_PTP_REMOTE_CONF" = "y" ]; then ;; esac if [ -f $tmpconfig ]; then - # copy it in place to use the new file (unless it is identical) - cmp -s $tmpconfig /wr/etc/ppsi.conf || \ - cp $tmpconfig /wr/etc/ppsi.conf + # copy it in place to use the new file + cp $tmpconfig /etc/ppsi.conf fi else # no valid PTP option keep ppsi.conf with old postfix echo "No valid PTP option in dot-config!" >& 2 - if [ -f /wr/etc/ppsi.conf ]; then - mv -f /wr/etc/ppsi.conf /wr/etc/ppsi.conf.old - fi fi diff --git a/userspace/rootfs_override/wr/bin/assembly_ppsi_conf.sh b/userspace/rootfs_override/wr/bin/assembly_ppsi_conf.sh index d92f42e2d34035b511c4a720d725c1f76f3ad6f6..036f982bf3954861929860f5bde76ec4c61bf5ba 100755 --- a/userspace/rootfs_override/wr/bin/assembly_ppsi_conf.sh +++ b/userspace/rootfs_override/wr/bin/assembly_ppsi_conf.sh @@ -4,7 +4,7 @@ # script to assembly ppsi.conf based on dot-config configuration PRE_FILE="/wr/etc/ppsi-pre.conf" -OUTPUT_FILE="/wr/etc/ppsi.conf" +OUTPUT_FILE="/etc/ppsi.conf" if [ -f /wr/etc/dot-config ]; then . /wr/etc/dot-config