From 580b2488ef91b4e470f59c1a1a3c34e1c7c8b4bb Mon Sep 17 00:00:00 2001 From: PiBa-NL Date: Thu, 1 Jun 2017 01:56:31 +0200 Subject: [PATCH 1/3] shellcmd, dont write the config when no changes where made, it pollutes the config backups --- .../files/usr/local/pkg/shellcmd.inc | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/sysutils/pfSense-pkg-Shellcmd/files/usr/local/pkg/shellcmd.inc b/sysutils/pfSense-pkg-Shellcmd/files/usr/local/pkg/shellcmd.inc index d60788651f3a..0829ad99c90f 100644 --- a/sysutils/pfSense-pkg-Shellcmd/files/usr/local/pkg/shellcmd.inc +++ b/sysutils/pfSense-pkg-Shellcmd/files/usr/local/pkg/shellcmd.inc @@ -143,16 +143,19 @@ function shellcmd_sync_package() { $i++; } } - - /* Write the new system configuration to config.xml from scratch when done */ - unset($config['system']['shellcmd']); - $config['system']['shellcmd'] = $a_shellcmd; - unset($config['system']['earlyshellcmd']); - $config['system']['earlyshellcmd'] = $a_earlyshellcmd; - unset($config['system']['afterfilterchangeshellcmd']); - $config['system']['afterfilterchangeshellcmd'] = $afterfilterchangeshellcmd; - write_config("[shellcmd] Successfully (re)synced shellcmd configuration."); - + if (($config['system']['shellcmd'] != $a_shellcmd) || + ($config['system']['earlyshellcmd'] != $a_earlyshellcmd) || + ($config['system']['afterfilterchangeshellcmd'] != $afterfilterchangeshellcmd)) { + /* Write the new system configuration to config.xml from scratch when done + but only if something changed */ + unset($config['system']['shellcmd']); + $config['system']['shellcmd'] = $a_shellcmd; + unset($config['system']['earlyshellcmd']); + $config['system']['earlyshellcmd'] = $a_earlyshellcmd; + unset($config['system']['afterfilterchangeshellcmd']); + $config['system']['afterfilterchangeshellcmd'] = $afterfilterchangeshellcmd; + write_config("[shellcmd] Successfully (re)synced shellcmd configuration."); + } } From 076747c9614242184e3c5a8a412b04cfbb89b88e Mon Sep 17 00:00:00 2001 From: PiBa-NL Date: Sat, 10 Jun 2017 22:32:56 +0200 Subject: [PATCH 2/3] shellcmd, bump version --- sysutils/pfSense-pkg-Shellcmd/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysutils/pfSense-pkg-Shellcmd/Makefile b/sysutils/pfSense-pkg-Shellcmd/Makefile index 4fe018689f8a..9080d5c2d019 100644 --- a/sysutils/pfSense-pkg-Shellcmd/Makefile +++ b/sysutils/pfSense-pkg-Shellcmd/Makefile @@ -2,7 +2,7 @@ PORTNAME= pfSense-pkg-Shellcmd PORTVERSION= 1.0.2 -PORTREVISION= 3 +PORTREVISION= 4 CATEGORIES= sysutils MASTER_SITES= # empty DISTFILES= # empty From 601e46b519711e31848d8bfa3929f73bfdb41a5d Mon Sep 17 00:00:00 2001 From: PiBa-NL Date: Thu, 13 Jul 2017 19:30:27 +0200 Subject: [PATCH 3/3] Multiple lines statement must be indented using 4 spaces. --- .../pfSense-pkg-Shellcmd/files/usr/local/pkg/shellcmd.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sysutils/pfSense-pkg-Shellcmd/files/usr/local/pkg/shellcmd.inc b/sysutils/pfSense-pkg-Shellcmd/files/usr/local/pkg/shellcmd.inc index 0829ad99c90f..90d66a5f7064 100644 --- a/sysutils/pfSense-pkg-Shellcmd/files/usr/local/pkg/shellcmd.inc +++ b/sysutils/pfSense-pkg-Shellcmd/files/usr/local/pkg/shellcmd.inc @@ -144,8 +144,8 @@ function shellcmd_sync_package() { } } if (($config['system']['shellcmd'] != $a_shellcmd) || - ($config['system']['earlyshellcmd'] != $a_earlyshellcmd) || - ($config['system']['afterfilterchangeshellcmd'] != $afterfilterchangeshellcmd)) { + ($config['system']['earlyshellcmd'] != $a_earlyshellcmd) || + ($config['system']['afterfilterchangeshellcmd'] != $afterfilterchangeshellcmd)) { /* Write the new system configuration to config.xml from scratch when done but only if something changed */ unset($config['system']['shellcmd']);