2023-10-28 21:38:26 +02:00
|
|
|
#!/bin/bash
|
2023-11-03 21:16:03 +01:00
|
|
|
########################################################
|
|
|
|
########################################################
|
|
|
|
# Wire-G App for simple management a Wireguard Tunnel ##
|
|
|
|
# Author: Désiré Werner Menrath ##
|
|
|
|
# Email: polunga40@unity-mail.de ##
|
|
|
|
# Translate German to English with LibreTranslate ##
|
|
|
|
# Translatefiles edit with Poedit ##
|
|
|
|
# Use without warranty! ##
|
|
|
|
########################################################
|
|
|
|
########################################################
|
2023-10-28 21:38:26 +02:00
|
|
|
|
|
|
|
############################################################################################################
|
|
|
|
############################################################################################################
|
|
|
|
|
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-11-19 20:05:23 +01: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-20 18:54:15 +01:00
|
|
|
echo $"Wire-G is installed..."
|
2023-11-19 11:15:52 +01:00
|
|
|
mkdir -p /home/"$USER"/.icons ; cp icons/* /home/"$USER"/.icons/ ; mkdir -p /home/"$USER"/.config/wg_nmcli
|
2023-11-03 21:16:03 +01:00
|
|
|
if ! which yad > /dev/null ; then sudo apt install yad -y > /dev/null 2>&1 ; echo yad wird installiert. Bitte warten... ; fi
|
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-20 18:54:15 +01:00
|
|
|
echo $"Wire-G is installed..."
|
2023-11-14 19:54:51 +01:00
|
|
|
mkdir -p /home/"$USER"/.icons ; cp icons/* /home/"$USER"/.icons/ ; mkdir -p /home/"$USER"/.config/wg_nmcli
|
2023-11-03 21:16:03 +01:00
|
|
|
if ! which yad > /dev/null ; then sudo pacman -S --noconfirm yad > /dev/null 2>&1 ; echo yad wird installiert. Bitte warten... ; fi
|
|
|
|
|
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-20 18:54:15 +01:00
|
|
|
echo $"Wire-G is installed..."
|
2023-11-14 19:54:51 +01:00
|
|
|
mkdir -p /home/"$USER"/.icons ; cp icons/* /home/"$USER"/.icons/ ; mkdir -p /home/"$USER"/.config/wg_nmcli
|
2023-11-03 21:16:03 +01:00
|
|
|
if ! which yad > /dev/null ; then sudo dnf install yad > /dev/null 2>&1 ; echo yad wird installiert. Bitte warten... ; fi
|
|
|
|
|
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
|
2023-11-20 18:54:15 +01:00
|
|
|
echo $"Attention OpenSuse is not officially supported!"
|
2023-11-03 11:13:42 +01:00
|
|
|
echo
|
2023-11-20 18:54:15 +01:00
|
|
|
echo $"yad must install them themselves when they continue!"
|
|
|
|
echo $"since these packages are officially not available."
|
2023-11-03 11:13:42 +01:00
|
|
|
echo
|
2023-11-20 18:54:15 +01:00
|
|
|
read -p $"Enter i for installation and enter key, break down with any other button ..." RESPONSE
|
2023-11-14 19:54:51 +01:00
|
|
|
if [ "$RESPONSE" == "i" ]
|
2023-11-03 11:13:42 +01:00
|
|
|
then
|
2023-11-20 18:54:15 +01:00
|
|
|
echo $"Wire-G is installed..."
|
2023-11-14 19:54:51 +01:00
|
|
|
mkdir -p /home/"$USER"/.icons ; cp icons/* /home/"$USER"/.icons/ ; mkdir -p /home/"$USER"/.config/wg_nmcli
|
2023-11-19 11:15:52 +01:00
|
|
|
|
2023-11-03 11:13:42 +01:00
|
|
|
else
|
|
|
|
exit 1
|
2023-11-20 12:28:28 +01:00
|
|
|
fi
|
2023-11-03 11:13:42 +01:00
|
|
|
else
|
2023-10-28 21:38:26 +02:00
|
|
|
clear
|
2023-11-20 20:06:33 +01:00
|
|
|
echo $"Your System could not be determined."
|
2023-11-03 11:13:42 +01:00
|
|
|
echo
|
2023-11-20 18:54:15 +01:00
|
|
|
read -n 1 -s -r -p $"To close the window press a button"
|
2023-11-03 11:13:42 +01:00
|
|
|
clear
|
|
|
|
exit 0
|
2023-10-28 21:38:26 +02:00
|
|
|
fi
|
|
|
|
|
2023-11-20 12:28:28 +01:00
|
|
|
if [ ! -d /home/"$USER"/.local/share ]
|
|
|
|
then
|
|
|
|
mkdir -p /home/"$USER"/.local/share
|
|
|
|
cp -r wg_nmcli /home/"$USER"/.local/share/
|
|
|
|
else
|
|
|
|
cp -r wg_nmcli /home/"$USER"/.local/share/
|
|
|
|
fi
|
2023-11-20 21:12:48 +01:00
|
|
|
if [ ! -d /home/"$USER"/.config/autostart ]
|
|
|
|
then
|
|
|
|
mkdir -p /home/"$USER"/.config/autostart
|
|
|
|
fi
|
2023-10-28 21:38:26 +02:00
|
|
|
wait;
|
|
|
|
sudo mkdir -p /usr/share/icons/Arch-Symbole ; sudo cp icons/wg-vpn.png /usr/share/icons/Arch-Symbole/
|
|
|
|
wait;
|
2023-11-16 20:08:18 +01:00
|
|
|
sudo cp wire_g /sbin/ ; sudo chmod +x /sbin/wire_g ; sudo cp wg_stop /sbin/ ; sudo chmod +x /sbin/wg_stop
|
2023-11-19 20:05:23 +01:00
|
|
|
wait;
|
|
|
|
sudo cp wg_on_start /sbin/ ; sudo chmod +x /sbin/wg_on_start
|
2023-10-28 21:38:26 +02:00
|
|
|
wait; sudo cp Wire-G.desktop /usr/share/applications/
|
|
|
|
echo
|
2023-11-05 17:56:17 +01:00
|
|
|
case $LANG in
|
|
|
|
de_DE.UTF-8) sudo cp languages/de/*.mo /usr/share/locale/de/LC_MESSAGES/ ;;
|
2023-11-06 09:11:37 +01:00
|
|
|
|
2023-11-20 18:54:15 +01:00
|
|
|
*) echo $"Wire-G uses the standard language." ;;
|
2023-11-05 17:56:17 +01:00
|
|
|
esac
|
2023-11-20 18:29:39 +01:00
|
|
|
clear
|
2023-11-20 18:54:15 +01:00
|
|
|
echo $"Installation successfully!"
|
2023-10-28 22:45:53 +02:00
|
|
|
echo
|
2023-11-20 18:54:15 +01:00
|
|
|
read -n 1 -s -r -p $"To close the window press a button"
|
2023-10-28 21:38:26 +02:00
|
|
|
clear
|
|
|
|
|
2023-11-01 21:05:18 +01:00
|
|
|
############################################ END ##########################################################
|