diff --git a/pkg/server/templates/usage.templ b/pkg/server/templates/usage.templ index 6b2eeb0..5ca7cc5 100644 --- a/pkg/server/templates/usage.templ +++ b/pkg/server/templates/usage.templ @@ -3,7 +3,7 @@ package templates import "converge/pkg/models" -templ AgentUsage(access models.ConvergeAccess, shells map[string]bool, usageInputs UsageInputs) { +templ AgentUsage(access models.ConvergeAccess, usageInputs UsageInputs) {
{addSshKeys(BASH, usageInputs.SshKeys)}
curl --fail-with-body http{access.Secure}://{access.HostPort}/downloads/agent > agent{`
chmod 755 agent
@@ -19,14 +19,14 @@ templ AgentUsage(access models.ConvergeAccess, shells map[string]bool, usageInpu
rm -f agent
`}
}
- if shells[CMD] {
+ if usageInputs.RemoteShells[CMD] {
{addSshKeys(CMD, usageInputs.SshKeys)}
curl --fail-with-body http{access.Secure}://{access.HostPort}/downloads/agent.exe > agent.exe{`
`}agent --id {usageInputs.Id} ws{access.Secure}://{access.HostPort}{`
del agent.exe
`}
}
- if shells[POWERSHELL] {
+ if usageInputs.RemoteShells[POWERSHELL] {
{addSshKeys(POWERSHELL, usageInputs.SshKeys)}
curl --fail-with-body http{access.Secure}://{access.HostPort}/downloads/agent.exe > agent.exe{`
`}agent --id {usageInputs.Id} ws{access.Secure}://{access.HostPort}{`
@@ -85,7 +85,7 @@ templ AgentUsage(access models.ConvergeAccess, shells map[string]bool, usageInpu
Working with the agent
- if shells[BASH] {
+ if usageInputs.RemoteShells[BASH] {
{`
# cd back to the agent directory
cd $agentdir
@@ -95,7 +95,7 @@ templ AgentUsage(access models.ConvergeAccess, shells map[string]bool, usageInpu
`}
}
- if shells[CMD] {
+ if usageInputs.RemoteShells[CMD] {
{`
# cd back to the agent directory
cd %agentdir%
@@ -104,7 +104,7 @@ templ AgentUsage(access models.ConvergeAccess, shells map[string]bool, usageInpu
echo > %agentdir%\.hold
`}
}
- if shells[POWERSHELL] {
+ if usageInputs.RemoteShells[POWERSHELL] {
{`
# cd back to the agent directory
cd $env:agentdir
@@ -113,8 +113,7 @@ templ AgentUsage(access models.ConvergeAccess, shells map[string]bool, usageInpu
$null > $env:agentdir\.hold
`}
}
- if shells[CMD] || shells[POWERSHELL] {
- windows
+ if usageInputs.RemoteShells[CMD] || usageInputs.RemoteShells[POWERSHELL] {
NOTE: When running the agent on windows, an exit of the remote session using
exit in powershell or command prompt does not terminate the shell completely.
@@ -130,7 +129,7 @@ templ AgentUsage(access models.ConvergeAccess, shells map[string]bool, usageInpu
templ ShellUsage(access models.ConvergeAccess, usageInputs UsageInputs) {
- @AgentUsage(access, usageInputs.RemoteShells, usageInputs)
+ @AgentUsage(access, usageInputs)
}
@@ -173,14 +172,14 @@ templ Usage(access models.ConvergeAccess) {
-
+