netvolt / LinuxRMM-Script

To help users that want to add Linux Agents to Tactical RMM, without need to pay upfront for code signed agents. Thanks to @ZoLuSs for the initial commit. If this solution works for you, consider contributing to Tactical RMM project!
MIT License
89 stars 39 forks source link

Update not working ('/tmp/temp_rmmagent': No such file or directory) #10

Closed Basecatcherz closed 1 year ago

Basecatcherz commented 1 year ago

Tried to use rmmagent-linux.sh update to update my agent. I've got this output and the agent isn't updated.

root@Docker-1:/opt/tacticalmesh# ./rmmagent-linux.sh update
tar (child): /tmp/golang.tar.gz: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
rm: cannot remove '/tmp/golang.tar.gz': No such file or directory
Golang Install Done !
Agent Compile begin
--2023-05-12 22:42:28--  https://github.com/amidaware/rmmagent/archive/refs/heads/master.zip
Resolving github.com (github.com)... 140.82.121.4
Connecting to github.com (github.com)|140.82.121.4|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://codeload.github.com/amidaware/rmmagent/zip/refs/heads/master [following]
--2023-05-12 22:42:28--  https://codeload.github.com/amidaware/rmmagent/zip/refs/heads/master
Resolving codeload.github.com (codeload.github.com)... 140.82.121.10
Connecting to codeload.github.com (codeload.github.com)|140.82.121.10|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/zip]
Saving to: ‘/tmp/rmmagent.zip’

/tmp/rmmagent.zip                     [ <=>                                                          ]  90.28K  --.-KB/s    in 0.01s   

2023-05-12 22:42:28 (7.38 MB/s) - ‘/tmp/rmmagent.zip’ saved [92443]

Archive:  /tmp/rmmagent.zip
7ea714fc0408677237dd9201403582818dc363a7
   creating: /tmp/rmmagent-master/
   creating: /tmp/rmmagent-master/.github/
   creating: /tmp/rmmagent-master/.github/workflows/
  inflating: /tmp/rmmagent-master/.github/workflows/ci.yml  
  inflating: /tmp/rmmagent-master/.gitignore  
   creating: /tmp/rmmagent-master/.vscode/
  inflating: /tmp/rmmagent-master/.vscode/settings.json  
  inflating: /tmp/rmmagent-master/LICENSE.md  
  inflating: /tmp/rmmagent-master/README.md  
   creating: /tmp/rmmagent-master/agent/
  inflating: /tmp/rmmagent-master/agent/agent.go  
  inflating: /tmp/rmmagent-master/agent/agent_unix.go  
  inflating: /tmp/rmmagent-master/agent/agent_windows.go  
  inflating: /tmp/rmmagent-master/agent/checkin.go  
  inflating: /tmp/rmmagent-master/agent/checks.go  
  inflating: /tmp/rmmagent-master/agent/choco_windows.go  
  inflating: /tmp/rmmagent-master/agent/eventlog_windows.go  
  inflating: /tmp/rmmagent-master/agent/install.go  
  inflating: /tmp/rmmagent-master/agent/install_unix.go  
  inflating: /tmp/rmmagent-master/agent/install_windows.go  
  inflating: /tmp/rmmagent-master/agent/patches_windows.go  
  inflating: /tmp/rmmagent-master/agent/process.go  
  inflating: /tmp/rmmagent-master/agent/rpc.go  
  inflating: /tmp/rmmagent-master/agent/services_windows.go  
  inflating: /tmp/rmmagent-master/agent/software_windows_386.go  
  inflating: /tmp/rmmagent-master/agent/software_windows_amd64.go  
  inflating: /tmp/rmmagent-master/agent/svc.go  
  inflating: /tmp/rmmagent-master/agent/syscall_windows.go  
  inflating: /tmp/rmmagent-master/agent/tasks_windows.go  
  inflating: /tmp/rmmagent-master/agent/utils.go  
  inflating: /tmp/rmmagent-master/agent/wmi_windows.go  
  inflating: /tmp/rmmagent-master/agent/wua_windows.go  
   creating: /tmp/rmmagent-master/build/
  inflating: /tmp/rmmagent-master/build/rmm.exe.manifest  
  inflating: /tmp/rmmagent-master/build/setup.iss  
  inflating: /tmp/rmmagent-master/go.mod  
  inflating: /tmp/rmmagent-master/go.sum  
  inflating: /tmp/rmmagent-master/main.go  
   creating: /tmp/rmmagent-master/shared/
  inflating: /tmp/rmmagent-master/shared/types.go  
  inflating: /tmp/rmmagent-master/versioninfo.json  
cp: cannot stat '/tmp/temp_rmmagent': No such file or directory
rm: cannot remove '/tmp/temp_rmmagent': No such file or directory
Tactical Agent Update is done
TidderM commented 1 year ago

You need to pass the arch as a parameter just like the install.

rmmagent-linux.sh update amd64 replacing amd64 with whatever arch you're working with.