Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shellcmd, dont write the config when no changes where made, it pollutes the config backups #365

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions sysutils/pfSense-pkg-Shellcmd/files/usr/local/pkg/shellcmd.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Multiple lines statement must be indented using 4 spaces

/* 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.");
}
}


Expand Down