Skip to content

Instantly share code, notes, and snippets.

@earnhardt3rd
Created June 19, 2023 13:56
Show Gist options
  • Save earnhardt3rd/3f32d51d3d909cd0ab1a7f801adb2959 to your computer and use it in GitHub Desktop.
Save earnhardt3rd/3f32d51d3d909cd0ab1a7f801adb2959 to your computer and use it in GitHub Desktop.
require 'getopts.pl';
Getopts('m:d:t');
my $MODE = uc($opt_m) || "";
my $DEBUG = $opt_d || 0;
if (defined $opt_t) { my %TEST = &buildManualWinFiles();}
1;
sub buildManualWinFiles {
my $line = $_[0];
print " W:$line\n" if $DEBUG > 0;
my $to = $line;
$to =~ s/NXROOT//g;
$to =~ s/^\\//;
$to =~ s/^\///;
$to =~ s/\\/_-_/g;
$to =~ s/\//_-_/g;
$to = "\%COMPUTERNAME\%\\$to";
$line =~ s/NXROOT/\%NXROOT\%/;
my $get = "copy \"$line\" \"${to}\"";
my $put = "copy \"$to\" \"$line\"";
open (GT,">> $gwFile");
print " gw: $get\n" if $DEBUG > 0;
print GT "$get\n";
close(GT);
open (GT,">> $pwFile");
print " gp: $put\n" if $DEBUG > 0;
print GT "$put\n";
close(GT);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment