summaryrefslogtreecommitdiffstats
path: root/move/etc-monitorer.pl
diff options
context:
space:
mode:
authorGuillaume Cottenceau <gc@mandriva.com>2003-11-20 10:59:00 +0000
committerGuillaume Cottenceau <gc@mandriva.com>2003-11-20 10:59:00 +0000
commit545da12f95f719e7ff675d113da196f634cb9888 (patch)
tree827b8b4bc455f5c4ce68eb7c41499fd1dcf0fb82 /move/etc-monitorer.pl
parentf84b7c9b7afb7cf81a0399ecaa6088c51f4ae581 (diff)
downloaddrakx-backup-do-not-use-545da12f95f719e7ff675d113da196f634cb9888.tar
drakx-backup-do-not-use-545da12f95f719e7ff675d113da196f634cb9888.tar.gz
drakx-backup-do-not-use-545da12f95f719e7ff675d113da196f634cb9888.tar.bz2
drakx-backup-do-not-use-545da12f95f719e7ff675d113da196f634cb9888.tar.xz
drakx-backup-do-not-use-545da12f95f719e7ff675d113da196f634cb9888.zip
speedup boot by launching etc-monitorer only one time from within drakx
Diffstat (limited to 'move/etc-monitorer.pl')
-rwxr-xr-xmove/etc-monitorer.pl18
1 files changed, 10 insertions, 8 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, $_);
+ }
}
}