#!/usr/bin/perl

######################
# Change this:
my $fileName = "/etc/hostconfig";
######################

# Find a filename that doesn't exist to do a backup
my $backupFileName = $fileName . ".applesaved";

if (-e $backupFileName) {
	my $N = 2;

	while (-e $backupFileName . $N) {
		$N = $N + 1;
	}
	$backupFileName = $backupFileName . $N;
}

# Make the backup copy
system("/bin/cp", "-f", $fileName, $backupFileName);

exit 0;