diff options
author | Pascal Rigaux <pixel@mandriva.com> | 1999-12-19 21:53:25 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 1999-12-19 21:53:25 +0000 |
commit | a6e4b3bd9ee2e545bb1e6a0dbfd5927336b24c0a (patch) | |
tree | 77d24453a8bc7d922ce7c0db91a8b306d4dd8d07 /init-sh/lib.sh | |
parent | 1fc64881efb19aa39393441c65705b638116db5f (diff) | |
download | msec-a6e4b3bd9ee2e545bb1e6a0dbfd5927336b24c0a.tar msec-a6e4b3bd9ee2e545bb1e6a0dbfd5927336b24c0a.tar.gz msec-a6e4b3bd9ee2e545bb1e6a0dbfd5927336b24c0a.tar.bz2 msec-a6e4b3bd9ee2e545bb1e6a0dbfd5927336b24c0a.tar.xz msec-a6e4b3bd9ee2e545bb1e6a0dbfd5927336b24c0a.zip |
*** empty log message ***
Diffstat (limited to 'init-sh/lib.sh')
-rw-r--r-- | init-sh/lib.sh | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/init-sh/lib.sh b/init-sh/lib.sh index e8798c7..6a613e9 100644 --- a/init-sh/lib.sh +++ b/init-sh/lib.sh @@ -46,30 +46,7 @@ AddRules() { AddBegRules() { echo "Modifying config in ${2}..." -/usr/bin/perl -e ' - my $m; - - $file = shift or die; - $temp = `mktemp /tmp/secure.XXXXXX`; - - chomp $temp; - - open FH, $file; - open FW, ">$temp"; - - while (<FH>) { - if (!/^\#/ && !/^$/ && !$m) { - print FW $ENV{"COMMENT"}; - print FW "\n"; - print FW "@ARGV\n\n"; $m++; - } - print FW; - } - close FH; - close FW; - - `mv -f $temp $file`; -' $@ + perl -pe -i '/^#/ or /^$/ or $m++ or print "$ENV{COMMENT}\n@ARGV\n\n"' $@ echo -e "done.\n" } |