Posted on 08-08-2019 01:25 PM
Here is a script that will allow you to put any bash command in the script's arguments of a policy. Not sure if this should go somewhere else, I'm not really active on the forums so I don't know. I just thought I'd offer it. I label "Parameters 4-11" as "bash command (%MOUNT %COMP %USER)".
#!/usr/bin/perl -w
use strict;
# %MOUNT %COMP %USER are replaced with $ARGV[0], $ARGV[1], $ARGV[2] respectively.
my ( $mount_point, $computer_name, $username ) = splice(@ARGV,0,3);
my $exit = 0;
my $debug = 0;
for my $arg ( @ARGV ) {
if ( $arg ne '' and $arg !~ /^#/ ) {
$arg =~ s/%MOUNT/$mount_point/;
$arg =~ s/%COMP/$computer_name/;
$arg =~ s/%USER/$username/;
print "$arg
" if $debug;
$exit += 1 if system $arg;
}
}
exit $exit;