summaryrefslogtreecommitdiffstats
path: root/move/etc-monitorer.pl
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-04-25 12:26:16 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-04-25 12:26:16 +0000
commit126777bc019a54afb4ec51299f2cf9d2841698aa (patch)
tree97f76e571902ead55ba138f1156a4b4f00b9b779 /move/etc-monitorer.pl
parentf1f67448efc714873378dfeb8279fae68054a90a (diff)
downloaddrakx-126777bc019a54afb4ec51299f2cf9d2841698aa.tar
drakx-126777bc019a54afb4ec51299f2cf9d2841698aa.tar.gz
drakx-126777bc019a54afb4ec51299f2cf9d2841698aa.tar.bz2
drakx-126777bc019a54afb4ec51299f2cf9d2841698aa.tar.xz
drakx-126777bc019a54afb4ec51299f2cf9d2841698aa.zip
re-sync after the big svn loss
Diffstat (limited to 'move/etc-monitorer.pl')
-rwxr-xr-xmove/etc-monitorer.pl32
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$_";
- }
-}