Wire-G/installer1.0.5
2023-11-03 11:13:42 +01:00

76 lines
3.4 KiB
Bash
Executable File

#!/bin/bash
############################################################################################################
############################################################################################################
# Angemeldeten Benutzer ermitteln
a_user=$(whoami)
# abfrage ob benötigte pakete installiert sind, wenn nicht dann installiere automatisch die benötigten Pakete.
if grep -i 'mint\|debian\|ubuntu\|pop|' /etc/os-release > /dev/null 2>&1
then
echo Wire-G wird installiert...
mkdir -p /home/"$a_user"/.icons ; cp icons/* /home/"$a_user"/.icons/ ; mkdir -p /home/"$a_user"/.config/wg_nmcli
if ! which yad > /dev/null ; then sudo apt install yad -y > /dev/null 2>&1 ; fi
echo yad wird installiert. Bitte warten...
if ! which notify-send > /dev/null ; then sudo apt install libnotify-bin -y > /dev/null 2>&1 ; fi
echo libnotify wird installiert. Bitte warten...
elif grep -i 'arch\|manjaro\|garuda\|endeavour|' /etc/os-release > /dev/null 2>&1
then
echo Wire-G wird installiert...
mkdir -p /home/"$a_user"/.icons ; cp icons/* /home/"$a_user"/.icons/ ; mkdir -p /home/"$a_user"/.config/wg_nmcli
if ! which yad > /dev/null ; then sudo pacman -S --noconfirm yad > /dev/null 2>&1 ; fi
echo yad wird installiert. Bitte warten...
if ! which notify-send > /dev/null ; then sudo pacman -S --noconfirm libnotify > /dev/null 2>&1 ; fi
echo libnotify wird installiert. Bitte warten...
elif grep -i 'fedora' /etc/os-release > /dev/null 2>&1
then
echo Wire-G wird installiert...
mkdir -p /home/"$a_user"/.icons ; cp icons/* /home/"$a_user"/.icons/ ; mkdir -p /home/"$a_user"/.config/wg_nmcli
if ! which yad > /dev/null ; then sudo dnf install yad > /dev/null 2>&1 ; fi
echo yad wird installiert. Bitte warten...
if ! which notify-send > /dev/null ; then sudo dnf install libnotify > /dev/null 2>&1 ; fi
echo libnotify wird installiert. Bitte warten...
elif grep -i 'suse' /etc/os-release > /dev/null 2>&1
then
clear
echo Achtung OpenSuse wird nicht offiziell unterstützt!
echo
echo yad und libnotify müssen sie selbst installieren, wenn sie fortfahren!
echo da dies Pakete offiziell nicht verfügbar sind.
echo
read -p "Geben Sie i für die installation ein und die Eingabetaste, Abbruch mit jeder anderen Taste ..." response
if [ "$response" == "i" ]
then
echo Wire-G wird installiert...
mkdir -p /home/"$a_user"/.icons ; cp icons/* /home/"$a_user"/.icons/ ; mkdir -p /home/"$a_user"/.config/wg_nmcli
else
exit 1
fi
else
clear
echo Ihr system konnte nicht ermittelt werden.
echo
read -n 1 -s -r -p "Zum Fenster schließen eine Taste drücken"
clear
exit 0
fi
wait;
sudo mkdir -p /usr/share/icons/Arch-Symbole ; sudo cp icons/wg-vpn.png /usr/share/icons/Arch-Symbole/
wait;
sudo cp wire_g wg_stop /sbin/ ; sudo chmod +x /sbin/wire_g ; sudo chmod +x /sbin/wg_stop
wait; sudo cp Wire-G.desktop /usr/share/applications/
echo
sudo cp languages/de/wire-g.mo /usr/share/locale/de/LC_MESSAGES/wire-g.mo
echo "Installation erfolgreich!"
echo
read -n 1 -s -r -p "Zum Fenster schließen eine Taste drücken"
clear
############################################ END ##########################################################