1
0
mirror of synced 2026-01-26 19:51:56 +00:00

Delete the file if it exists

This commit is contained in:
Steve Kemp
2008-11-23 21:12:36 +00:00
parent 996e7d7e1f
commit 1b6d3dbdeb

View File

@@ -1812,11 +1812,19 @@ EOF
#
my $cfg =
$CONFIG{'output'} . "/" . $CONFIG{'hostname'} . $CONFIG{'extension'};
if ( ( -e $cfg ) && ( !$CONFIG{'force'} ) )
if ( -e $cfg )
{
print "Configuration file already exists; $cfg\n";
print "Aborting\n";
exit 127;
if ( $CONFIG{'force'} )
{
$CONFIG{'verbose'} && print "Removing existing file: $cfg\n";
unlink( $cfg );
}
else
{
print "Configuration file already exists; $cfg\n";
print "Aborting\n";
exit 127;
}
}
}