mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-09 18:45:54 +02:00
guardian: Use new system methods
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
@@ -67,8 +67,8 @@ my $settingsfile = "${General::swroot}/guardian/settings";
|
||||
my $ignoredfile = "${General::swroot}/guardian/ignored";
|
||||
|
||||
# Create empty settings and ignoredfile if they do not exist yet.
|
||||
unless (-e "$settingsfile") { system("touch $settingsfile"); }
|
||||
unless (-e "$ignoredfile") { system("touch $ignoredfile"); }
|
||||
unless (-e "$settingsfile") { &General::system("touch", "$settingsfile"); }
|
||||
unless (-e "$ignoredfile") { &General::system("touch", "$ignoredfile"); }
|
||||
|
||||
our %settings = ();
|
||||
our %ignored = ();
|
||||
@@ -878,7 +878,7 @@ sub BuildConfiguration() {
|
||||
my $configfile = "${General::swroot}/guardian/guardian.conf";
|
||||
|
||||
# Create the configfile if none exists yet.
|
||||
unless (-e "$configfile") { system("touch $configfile"); }
|
||||
unless (-e "$configfile") { &General::system("touch", "$configfile"); }
|
||||
|
||||
# Open configfile for writing.
|
||||
open(FILE, ">$configfile");
|
||||
@@ -940,11 +940,11 @@ sub BuildConfiguration() {
|
||||
&Guardian::Socket::Client("reload");
|
||||
} else {
|
||||
# Launch guardian.
|
||||
system("/usr/local/bin/addonctrl guardian start &>/dev/null");
|
||||
&General::system("/usr/local/bin/addonctrl", "guardian", "start");
|
||||
}
|
||||
} else {
|
||||
# Stop the daemon.
|
||||
system("/usr/local/bin/addonctrl guardian stop &>/dev/null");
|
||||
&General::system("/usr/local/bin/addonctrl", "guardian", "stop");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -955,7 +955,7 @@ sub GenerateIgnoreFile() {
|
||||
&General::readhasharray($ignoredfile, \%ignored);
|
||||
|
||||
# Create the guardian.ignore file if not exist yet.
|
||||
unless (-e "$ignorefile") { system("touch $ignorefile"); }
|
||||
unless (-e "$ignorefile") { &General::system("touch", "$ignorefile"); }
|
||||
|
||||
# Open ignorefile for writing.
|
||||
open(FILE, ">$ignorefile");
|
||||
|
||||
Reference in New Issue
Block a user