Leser: 24
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
#!/usr/bin/perl #module use strict; #definition variabeln my $datei; my $ziel; my $znet; my $count=1; my $pass; #abfrage inputs print "SMB COPY to Client\n"; print "-------------------------\n\n\n"; print "Please enter Filename ():\t"; $datei = <STDIN>; print "Please enter Path on Target (c\..):\t"; $ziel = <STDIN>; print "Please enter Target Network (2=HQ, 100= Berlin etc.):\t"; $znet = <STDIN>; print "Please enter Password (localadmin):"; $pass = <STDIN>; chomp($datei); $datei =~ s!\n$!!; chomp($ziel); $ziel =~ s!\n$!!; chomp($znet); $znet =~ s!\n$!!; chomp($pass); $pass =~ s!\n$!!; #funktion smbcopy while ($count<255) { $count++; print "$count\n"; my $anweisung="sudo smbmount //192.168.$znet.151/c\$/$ziel /upload/ -o username\=administrator,password\='$pass'"; print "$anweisung"; exec ("$anweisung"); exec ("sudo cp $datei /upload/"); exec ("umount /upload/"); if ($count==253) { redo; } }
chomp($datei, $ziel, $znet, $pass);