#!/opt/perl/bin/perl print "Hostname:  "; $host = <>; chomp($host); $path = '/var/opt/ignite/recovery/archives/'; $access = '-anon=2,access='; $complete = "$path".$host." "."$access".$host; $found_host = 0; $found_host2 = 0; $file = "/etc/exports"; open(EXPORTS, "$file")|| die "/etc/exports konnte nicht geoeffnet werden"; while() {         if(index($_, ":$host") > -1)         {                $found_host2 = 1;         }         elsif(index($_, "$path".$host." "."$access".$host) > -1)         {                $found_host = 1;         } } close(EXPORTS); unless($found_host == 1) {      open(EXPORTS, ">>$file")|| die "Konnte /etc/exports nicht oeffnen ";      print EXPORTS "$complete";      close(EXPORTS);      print "Host $host erfolgreich importert\n";      mkdir "$path$host"; } unless($found_host2 == 1) {      open FILE, $file;      my @lines = ;      map (chomp, @lines);      $lines[0] .= ":$host";      open FILE, ">$file";      print FILE join("\n", @lines);      close(FILE);      mkdir "$path$host"; } else {      print "Host $host bereits vorhanden\n"; }