Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
jm33-m0 committed Jan 3, 2025
1 parent 0abb4a0 commit ae74be0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
3 changes: 3 additions & 0 deletions core/lib/cc/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package cc

import (
"os"
"strconv"
"strings"
"sync"
Expand Down Expand Up @@ -109,6 +110,8 @@ func CmdHandler(cmd string) (err error) {
if err != nil {
return
}
TmuxDeinitWindows()
os.Exit(0)

case cmdSplit[0] == HELP:
if len(cmdSplit) > 2 {
Expand Down
13 changes: 7 additions & 6 deletions core/lib/cc/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"os"
"os/exec"
"strings"
"syscall"
"time"

"github.com/cavaliergopher/grab/v3"
Expand Down Expand Up @@ -201,16 +202,16 @@ func UpdateCC(force bool) (err error) {
install_cmd := fmt.Sprintf("bash -c 'tar -I zstd -xvf %s -C /tmp && cd /tmp/emp3r0r-build && sudo ./emp3r0r --install; sleep 5'", path)
CliPrint("Running installer command: %s. Please run `tmux kill-session -t emp3r0r` after installing", install_cmd)

// find x-terminal-emulator, it should be available on most Linux distros, tested on Kali
x_terminal_emulator, err := exec.LookPath("x-terminal-emulator")
wrapper, err := exec.LookPath("x-terminal-emulator")
if err != nil {
return fmt.Errorf("failed to find x-terminal-emulator: %v. your distribution is unsupported", err)
return fmt.Errorf("%v. your distribution is unsupported", err)
}
err = exec.Command(x_terminal_emulator, "-e", install_cmd).Run()
cmd := exec.Command(wrapper, "-e", install_cmd)
cmd.SysProcAttr = &syscall.SysProcAttr{Setsid: true}
out, err := cmd.CombinedOutput()
if err != nil {
return fmt.Errorf("failed to update emp3r0r: %v", err)
return fmt.Errorf("failed to update emp3r0r: %v: %s", err, out)
}
defer TmuxDeinitWindows()

return nil
}

0 comments on commit ae74be0

Please sign in to comment.