zenidrv-g203/es-ES/zenidrv-g203-admin

79 lines
2.5 KiB
Plaintext
Raw Normal View History

2021-07-19 13:44:56 +02:00
#!/bin/bash
#############################################################
# Zenity interface for G203 (Prodigy & Ligthsync) driver #
2021-08-24 15:12:34 +02:00
# Last change: 24-08-2021 #
2021-07-19 13:44:56 +02:00
# Author: q3aql #
2021-08-24 15:12:34 +02:00
# Contact: q3aql@duck.com #
2021-07-19 13:44:56 +02:00
# License: GPL v2.0 #
#############################################################
2021-08-24 15:12:34 +02:00
VERSION="1.3"
M_DATE="240821"
2021-07-19 13:44:56 +02:00
# Variables
iconPath="/usr/share/icons/logitech/logitech-black.png"
# Link with gksudo,gksu o bessu
function showRootMessage() {
if [ -f /usr/bin/gksudo ] ; then
gksudo /usr/bin/zenidrv-g203
exit
elif [ -f /bin/gksudo ] ; then
gksudo /usr/bin/zenidrv-g203
exit
elif [ -f /usr/bin/gksu ] ; then
gksu /usr/bin/zenidrv-g203
exit
elif [ -f /bin/gksu ] ; then
gksu /usr/bin/zenidrv-g203
exit
elif [ -f /usr/bin/beesu ] ; then
beesu /usr/bin/zenidrv-g203
exit
elif [ -f /bin/beesu ] ; then
beesu /usr/bin/zenidrv-g203
exit
elif [ -f /bin/sudo ] ; then
xterm -T "zenidrv-g203 ${VERSION} (${M_DATE})" -fa Monospace -fs 10 -bg white -fg black -e "sudo zenidrv-g203"
exit
elif [ -f /usr/bin/sudo ] ; then
xterm -T "zenidrv-g203 ${VERSION} (${M_DATE})" -fa Monospace -fs 10 -bg white -fg black -e "sudo zenidrv-g203"
exit
elif [ -f /usr/bin/su ] ; then
xterm -T "zenidrv-g203 ${VERSION} (${M_DATE})" -fa Monospace -fs 10 -bg white -fg black -e "su -c 'zenidrv-g203'"
exit
elif [ -f /bin/su ] ; then
xterm -T "zenidrv-g203 ${VERSION} (${M_DATE})" -fa Monospace -fs 10 -bg white -fg black -e "su -c 'zenidrv-g203'"
exit
else
zenity -h &> /dev/null
output=$?
if [ ${output} -eq 0 ] ; then
zenity --title "zenidrv-g203 ${VERSION} (${M_DATE})" --window-icon=${iconPath} --info \
--text "El programa 'zenidrv-g203' no pudo ser ejecutado como administrador\n\nPor favor, ejecuta el comando 'zenidrv-g203' como root en tu terminal"
else
xterm -T "zenidrv-g203 ${VERSION} (${M_DATE})" -fa Monospace -fs 10 -bg white -fg black -e "zenidrv-g203-admin --error"
fi
fi
}
# Function to show error message
function errorMessage() {
echo ""
echo "* ATTENTION!:"
echo ""
echo "* El programa 'zenidrv-g203' no pudo ser ejecutado como administrador"
echo ""
echo "* Por favor, ejecuta el comando 'zenidrv-g203' como root en tu terminal"
echo ""
echo -n "* Pulsa ENTER para salir... " ; read continue
exit
}
# Startup script
if [ "${1}" == "--error" ] ; then
errorMessage
else
showRootMessage
fi