mirror of
https://github.com/schoebel/mars
synced 2025-02-16 20:16:57 +00:00
marsadm: safeguard unnecessary template file generation
This commit is contained in:
parent
835fb864c3
commit
9440d2b5e8
@ -377,9 +377,10 @@ sub instantiate_systemd_unit {
|
||||
$text = subst_systemd_vars(0, $cmd, $res, $text);
|
||||
if (open(IN, "< $outfile")) {
|
||||
# Check whether something has changed
|
||||
local $/; # slurp
|
||||
my $old = <IN>;
|
||||
close(IN);
|
||||
if ($old eq $text) {
|
||||
if (defined($old) && $old eq $text) {
|
||||
lprint "== systemd unit '$outfile' has not changed\n" if $verbose;
|
||||
return (0, $outfile);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user