Update JNC-Scan_Launcher.sh
This commit is contained in:
@@ -1,16 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Obtener el directorio donde está el script
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
cd "$DIR"
|
||||
|
||||
# Comprobar si se está ejecutando en una terminal
|
||||
if [ -t 0 ]; then
|
||||
# Estamos en una terminal, pedir sudo directamente
|
||||
echo "Iniciando JNC-Scan..."
|
||||
sudo ./venv/bin/python3 main.py
|
||||
else
|
||||
# No estamos en una terminal (doble clic), intentar abrir una
|
||||
if command -v gnome-terminal &> /dev/null; then
|
||||
gnome-terminal -- bash -c "sudo $DIR/venv/bin/python3 main.py; exec bash"
|
||||
elif command -v x-terminal-emulator &> /dev/null; then
|
||||
@@ -18,7 +11,6 @@ else
|
||||
elif command -v xterm &> /dev/null; then
|
||||
xterm -e "sudo $DIR/venv/bin/python3 main.py"
|
||||
else
|
||||
# Fallback gráfico si no hay terminal detectada (usando pkexec si existe)
|
||||
if command -v pkexec &> /dev/null; then
|
||||
pkexec $DIR/venv/bin/python3 main.py
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user