Permalink
Browse files

copy original psad.conf before install and restore at conclusion

  • Loading branch information...
1 parent 1248009 commit 6616c6c18bf27288fa38c566b8e90bf07a6ddda5 @mrash committed Mar 23, 2012
Showing with 13 additions and 1 deletion.
  1. +13 −1 install.pl
View
@@ -11,7 +11,7 @@
#
# Credits: (see the CREDITS file)
#
-# Copyright (C) 1999-2011 Michael Rash (mbr@cipherdyne.org)
+# Copyright (C) 1999-2012 Michael Rash (mbr@cipherdyne.org)
#
# License (GNU Public License):
#
@@ -200,6 +200,10 @@
### set LC_ALL env variable
$ENV{'LC_ALL'} = $locale unless $no_locale;
+### make a copy of the original psad.conf file and restore at the end
+copy $psad_conf_file, "${psad_conf_file}.orig" or die "[*] Could not ",
+ "copy $psad_conf_file -> $psad_conf_file.orig";
+
$install_root = getcwd() . '/test/psad-install' if $install_test_dir;
### import paths from default psad.conf
@@ -262,6 +266,13 @@
print F for @installation_lines;
close F;
+### restore the original psad.conf file (this is just the local one in the
+### sources directory).
+if (-e "${psad_conf_file}.orig") {
+ copy "${psad_conf_file}.orig", $psad_conf_file or die "[*] Could not ",
+ "copy $psad_conf_file.orig -> $psad_conf_file";
+}
+
exit 0;
#================= end main =================
@@ -757,6 +768,7 @@ ()
&logr("\n[+] To start psad, run ${USRSBIN_DIR}/psad\"\n");
}
}
+
return;
}

0 comments on commit 6616c6c

Please sign in to comment.