#!/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 = ; print "Please enter Path on Target (c\..):\t"; $ziel = ; print "Please enter Target Network (2=HQ, 100= Berlin etc.):\t"; $znet = ; print "Please enter Password (localadmin):"; $pass = ; 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; } }