Created
July 2, 2019 09:52
-
-
Save cleverca22/27743f4d5efcba4d078ca49547bdb534 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub run { | |
my ($cmd) = @_; | |
my @args = split " ", $cmd; | |
my $prog; | |
if (substr($args[0], 0, 1) eq "@") { | |
$prog = substr($args[0], 1); | |
shift @args; | |
} else { | |
$prog = $args[0]; | |
} | |
my $pid = fork; | |
if ($pid == 0) { | |
setpgrp; # don't receive SIGINT etc. from terminal | |
exec { $prog } @args; | |
die "failed to exec $prog\n"; | |
} elsif (!defined $pid) { | |
die "failed to fork: $!\n"; | |
} | |
return $pid; | |
}; | |
my $cmd = q{/bin/sudo -E -u oauth2_proxy /nix/store/76p8l704spnqqsp1f1zkqnb12ndkyp59-oauth2_proxy-3.2.0-bin/bin/oauth2_proxy --approval-prompt='force' --client-id='xxxx' --client-secret='xxxx' --cookie-expire='168h0m0s' --cookie-httponly=true --cookie-name='_oauth2_proxy' --cookie-secret='fake' --cookie-secure=false --email-domain='iohk.io' --http-address='http://127.0.0.1:4180' --pass-access-token=false --pass-basic-auth=true --pass-host-header=true --provider='google' --proxy-prefix='/oauth2' --redirect-url='http://localhost.earthtools.ca/oauth2/callback' --request-logging=true --set-xauthrequest=true }; | |
print STDERR "running ExecStart: $cmd\n"; | |
my $mainPid = run $cmd; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment