Wire-G/installer1.0.5

76 lines
3.4 KiB
Groff
Raw Normal View History

2023-10-28 21:38:26 +02:00
#!/bin/bash
############################################################################################################
############################################################################################################
# Angemeldeten Benutzer ermitteln
a_user=$(whoami)
2023-10-29 10:27:12 +01:00
# abfrage ob benötigte pakete installiert sind, wenn nicht dann installiere automatisch die benötigten Pakete.
2023-10-28 21:38:26 +02:00
2023-10-29 10:27:12 +01:00
if grep -i 'mint\|debian\|ubuntu\|pop|' /etc/os-release > /dev/null 2>&1
2023-10-28 21:38:26 +02:00
then
2023-11-03 11:13:42 +01:00
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...
2023-11-02 11:01:37 +01:00
if ! which notify-send > /dev/null ; then sudo apt install libnotify-bin -y > /dev/null 2>&1 ; fi
echo libnotify wird installiert. Bitte warten...
2023-10-29 10:58:59 +01:00
2023-10-29 10:27:12 +01:00
elif grep -i 'arch\|manjaro\|garuda\|endeavour|' /etc/os-release > /dev/null 2>&1
2023-10-28 21:38:26 +02:00
then
2023-11-03 11:13:42 +01:00
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...
2023-11-02 11:01:37 +01:00
if ! which notify-send > /dev/null ; then sudo pacman -S --noconfirm libnotify > /dev/null 2>&1 ; fi
echo libnotify wird installiert. Bitte warten...
2023-11-03 11:13:42 +01:00
2023-10-29 10:27:12 +01:00
elif grep -i 'fedora' /etc/os-release > /dev/null 2>&1
2023-10-28 21:38:26 +02:00
then
2023-11-03 11:13:42 +01:00
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
2023-11-02 11:01:37 +01:00
if ! which yad > /dev/null ; then sudo dnf install yad > /dev/null 2>&1 ; fi
echo yad wird installiert. Bitte warten...
2023-11-02 11:01:37 +01:00
if ! which notify-send > /dev/null ; then sudo dnf install libnotify > /dev/null 2>&1 ; fi
echo libnotify wird installiert. Bitte warten...
2023-10-29 10:27:12 +01:00
elif grep -i 'suse' /etc/os-release > /dev/null 2>&1
2023-10-28 21:38:26 +02:00
then
2023-11-03 11:13:42 +01:00
clear
echo Achtung OpenSuse wird nicht offiziell unterstützt!
echo
echo yad und libnotify müssen sie selbst installieren, wenn sie fortfahren!
2023-11-03 14:07:20 +01:00
echo da diese Pakete offiziell nicht verfügbar sind.
2023-11-03 11:13:42 +01:00
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
2023-10-28 21:38:26 +02:00
clear
echo Ihr system konnte nicht ermittelt werden.
2023-11-03 11:13:42 +01:00
echo
read -n 1 -s -r -p "Zum Fenster schließen eine Taste drücken"
clear
exit 0
2023-10-28 21:38:26 +02:00
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
2023-11-03 07:46:20 +01:00
sudo cp languages/de/wire-g.mo /usr/share/locale/de/LC_MESSAGES/wire-g.mo
2023-10-28 21:38:26 +02:00
echo "Installation erfolgreich!"
2023-10-28 22:45:53 +02:00
echo
2023-10-28 21:38:26 +02:00
read -n 1 -s -r -p "Zum Fenster schließen eine Taste drücken"
clear
2023-11-01 21:05:18 +01:00
############################################ END ##########################################################