diff options
-rwxr-xr-x | move/etc-monitorer.pl | 18 | ||||
-rw-r--r-- | move/move.pm | 2 |
2 files changed, 11 insertions, 9 deletions
diff --git a/move/etc-monitorer.pl b/move/etc-monitorer.pl index eb09c1e8f..0593554ac 100755 --- a/move/etc-monitorer.pl +++ b/move/etc-monitorer.pl @@ -8,13 +8,15 @@ sub logit { outpend "/var/log/etc-monitorer.log", sprintf("[%s] @_\n", chomp_(`d my $machine_ident = cat_('/var/lib/machine_ident'); my $sysconf = "/home/.sysconf/$machine_ident"; -foreach (glob_("$ARGV[0]/*")) { - next if $_ eq '/etc/sudoers'; #- /etc/sudoers can't be a link - if (-f && !-l) { - my $dest = "/home/.sysconf/$machine_ident$_"; - mkdir_p(dirname($dest)); #- case of newly created directories - logit("restoring broken symlink $_ -> $dest"); - system("mv $_ $dest"); - symlink($dest, $_); +foreach my $dir (@ARGV) { + foreach (glob_("$dir/*")) { + next if $_ eq '/etc/sudoers'; #- /etc/sudoers can't be a link + if (-f && !-l) { + my $dest = "/home/.sysconf/$machine_ident$_"; + mkdir_p(dirname($dest)); #- case of newly created directories + logit("restoring broken symlink $_ -> $dest"); + system("mv $_ $dest"); + symlink($dest, $_); + } } } diff --git a/move/move.pm b/move/move.pm index 5570e545c..23c140601 100644 --- a/move/move.pm +++ b/move/move.pm @@ -422,7 +422,7 @@ sub install2::startMove { if (cat_('/proc/mounts') =~ m|\s/home\s|) { output '/var/lib/machine_ident', machine_ident(); - run_program::run('/usr/bin/etc-monitorer.pl', $_) foreach uniq map { dirname($_) } chomp_(`find /etc -type f`); + run_program::run('/usr/bin/etc-monitorer.pl', uniq map { dirname($_) } chomp_(`find /etc -type f`)); run_program::raw({ detach => 1 }, '/usr/bin/dnotify', '-MCR', '/etc', '-r', '-e', '/usr/bin/etc-monitorer.pl', '{}') or die "dnotify not found!"; } |