Skip to content

Commit e3cfe35

Browse files
fix(enroll.nu): drop PowerShell-style line continuation
1 parent b763ab7 commit e3cfe35

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

enroll.nu

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#
44
# Usage:
55
# nu enroll.nu "<JWT>"
6-
# ./enroll.nu "<JWT>" (Linux/macOS, after chmod +x)
76
#
87
# Wipes the previous enrollment, runs `up` with hard-coded advertise lists
98
# matching the project's smoke-test setup, then starts the agent service in
@@ -13,22 +12,19 @@ def main [jwt: string] {
1312
let agent = "D:\\dgw-pr2\\target\\release\\devolutions-agent.exe"
1413
let agent_dir = "C:\\ProgramData\\Devolutions\\Agent"
1514
let cert_dir = $"($agent_dir)\\certs"
15+
let agent_json = $"($agent_dir)\\agent.json"
1616

1717
print "==> Stopping any running agent"
18-
try { ps | where name == "devolutions-agent.exe" | each { |p| kill $p.pid } | ignore } catch { }
18+
try { ps | where name == "devolutions-agent.exe" | each { |p| kill $p.pid } | ignore }
1919

2020
print "==> Wiping previous enrollment state"
21-
let agent_json = $"($agent_dir)\\agent.json"
2221
if ($agent_json | path exists) { rm $agent_json }
2322
if ($cert_dir | path exists) {
2423
ls $cert_dir | where name =~ '(-cert\.pem|-key\.pem|gateway-ca\.pem)$' | each { |f| rm $f.name } | ignore
2524
}
2625

2726
print "==> Bootstrapping agent (devolutions-agent up)"
28-
^$agent up `
29-
--enrollment-string $jwt `
30-
--advertise-routes "10.0.0.0/8,192.168.0.0/16" `
31-
--advertise-domains "it-help.ninja"
27+
^$agent up --enrollment-string $jwt --advertise-routes "10.0.0.0/8,192.168.0.0/16" --advertise-domains "it-help.ninja"
3228

3329
print "==> Starting agent service (foreground, Ctrl-C to stop)"
3430
^$agent run

0 commit comments

Comments
 (0)