diff options
author | Mystery Man <unknown@mandriva.org> | 2005-09-02 16:38:15 +0000 |
---|---|---|
committer | Mystery Man <unknown@mandriva.org> | 2005-09-02 16:38:15 +0000 |
commit | d53d83f3f80a9cad384644bb0d98b4d3d257b4d8 (patch) | |
tree | 575ef8f623300f7315ed26bec8c2ef670327366f /move/etc-monitorer.pl | |
parent | 46a079ddbe5c93b62183e0a30aed11328eee5939 (diff) | |
download | drakx-10_3_0_52mdk.tar drakx-10_3_0_52mdk.tar.gz drakx-10_3_0_52mdk.tar.bz2 drakx-10_3_0_52mdk.tar.xz drakx-10_3_0_52mdk.zip |
This commit was manufactured by cvs2svn to create tagV10_3_0_52mdk
'V10_3_0_52mdk'.
Diffstat (limited to 'move/etc-monitorer.pl')
-rwxr-xr-x | move/etc-monitorer.pl | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/move/etc-monitorer.pl b/move/etc-monitorer.pl deleted file mode 100755 index 231b9f772..000000000 --- a/move/etc-monitorer.pl +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/perl - -use MDK::Common; - -sub outpend { my $f = shift; local *F; open F, ">>$f" or die "outpend in file $f failed: $!\n"; print F foreach @_ } -sub logit { outpend "/var/log/etc-monitorer.log", sprintf("[%s] @_\n", chomp_(`date`)) } - -foreach my $dir (@ARGV) { - my $destdir = '/home/.sysconf/' . cat_('/var/lib/machine_ident'); - my @etcfiles = glob_("$dir/*"); - foreach (@etcfiles) { - if ($_ eq '/etc/sudoers' #- /etc/sudoers can't be a link - || $_ eq '/etc/mtab' #- same for /etc/mtab - || !-f - || -l && readlink =~ m|^/|) { #- we want to trap relative symlinks only - next; - } - my $dest = "$destdir$_"; - mkdir_p(dirname($dest)); #- case of newly created directories - logit("restoring broken symlink $_ -> $dest"); - if (-l) { - system("cp $_ $dest 2>/dev/null"); - } else { - system("mv $_ $dest 2>/dev/null"); - } - symlinkf($dest, $_); - } - foreach (difference2([ grep { -f && s/^\Q$destdir\E// } glob_("$destdir$dir/*") ], [ @etcfiles ])) { - logit("removing $destdir$_ because of deleted $_"); - unlink "$destdir$_"; - } -} |