134 lines
		
	
	
		
			5.4 KiB
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			134 lines
		
	
	
		
			5.4 KiB
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
#!/bin/bash
 | 
						|
NORMAL='\033[0m'
 | 
						|
GREEN='\033[1;32m'
 | 
						|
RED='\033[31;1;42m'
 | 
						|
BLUE='\033[30;1;34m'
 | 
						|
 | 
						|
install_file_with(){
 | 
						|
  clear
 | 
						|
  mkdir -p ~/.config/wire_py && touch ~/.config/wire_py/keys && cp -u settings ~/.config/wire_py/ && \
 | 
						|
  mkdir -p ~/.config/systemd/user && cp -u wg_start.service ~/.config/systemd/user/ && \
 | 
						|
  systemctl --user enable wg_start.service
 | 
						|
  sudo apt install python3-tk && \
 | 
						|
  sudo cp -u wg_main.py start_wg.py cls_mth_fc.py /usr/local/bin/ && \
 | 
						|
  sudo cp -uR wp-icons lx-icons /usr/share/icons/ &&  sudo cp -uR TK-Themes /usr/share/ && \
 | 
						|
  sudo cp -u languages/de/*.mo /usr/share/locale/de/LC_MESSAGES/ && \
 | 
						|
  sudo ln -sf /usr/local/bin/wg_main.py /usr/local/bin/wirepy && \
 | 
						|
  sudo cp -u Wire-Py.desktop /usr/share/applications/ 
 | 
						|
  }
 | 
						|
 | 
						|
install_arch_d(){
 | 
						|
  clear
 | 
						|
  sudo pacman -S --noconfirm tk python3 python-requests && \
 | 
						|
  sudo cp -u wg_main.py start_wg.py cls_mth_fc.py && \
 | 
						|
  sudo mkdir -p /etc/wire_py && sudo touch /etc/wire_py/keys && sudo cp -u settings  /etc/wire_py/ && \
 | 
						|
  sudo cp -uR wp-icons lx-icons /usr/share/icons/ && sudo cp -uR TK-Themes /usr/share/ && \
 | 
						|
  sudo chown -R root:root /etc/wire_py && sudo chmod 755 /etc/wire_py && \
 | 
						|
  sudo cp -u languages/de/*.mo /usr/share/locale/de/LC_MESSAGES/ && \
 | 
						|
  sudo ln -sf /usr/bin/wirepy.py /usr/local/bin/wirepy && \
 | 
						|
  sudo cp -u org.wirepy.policy /usr/share/polkit-1/actions/ && \
 | 
						|
  sudo cp -u Wire-Py.desktop /usr/share/applications/ && \
 | 
						|
  sudo cp -u wg_start.service /lib/systemd/system/ && \
 | 
						|
  sudo systemctl enable wg_start.service
 | 
						|
  }
 | 
						|
 | 
						|
if grep -i 'debian' /etc/os-release > /dev/null 2>&1
 | 
						|
  then
 | 
						|
    groups > /tmp/isgroup
 | 
						|
    if grep 'sudo' /tmp/isgroup
 | 
						|
      then
 | 
						|
          install_file_with
 | 
						|
 | 
						|
    else
 | 
						|
 | 
						|
    echo -e "$BLUE"The installer found that they are not in the group sudo.""
 | 
						|
    echo -e "with "$RED"su -"$BLUE" "they can enter the root shell in which they then""
 | 
						|
    echo -e "enter "$GREEN""usermod -aG sudo $USER.""$BLUE""
 | 
						|
    echo -e ""after logging in from the system, they can then run Wire-Py install again." $NORMAL"
 | 
						|
    read -n 1 -s -r -p $"To close the Window press a button"
 | 
						|
    clear
 | 
						|
    exit 0
 | 
						|
    fi
 | 
						|
 | 
						|
 | 
						|
elif grep -i 'mint\|ubuntu\|pop|' /etc/os-release > /dev/null 2>&1
 | 
						|
  then
 | 
						|
      install_file_with
 | 
						|
 | 
						|
 | 
						|
elif grep -i 'arch' /etc/os-release > /dev/null 2>&1
 | 
						|
    then
 | 
						|
        groups > /tmp/isgroup
 | 
						|
        clear
 | 
						|
        if grep 'wheel' /tmp/isgroup
 | 
						|
          then
 | 
						|
              install_arch_d
 | 
						|
        else
 | 
						|
            echo "The installer found that they are not in the group sudo."
 | 
						|
            echo "The sudoers file must be edited with"
 | 
						|
            echo -e "$RED""su -""$NORMAL"
 | 
						|
            echo -e "$GREEN"""EDITOR=nano visudo"""$NORMAL"
 | 
						|
            echo "Find the line:"
 | 
						|
            echo "## Uncomment to allow members of group wheel to execute any command"
 | 
						|
            echo "remove '#' on  # %wheel ALL=(ALL) ALL and save the file"
 | 
						|
            echo -e "then enter "$GREEN"gpasswd -a $USER wheel.""$NORMAL"
 | 
						|
            echo "after logging in from the system, they can then run Wire-Py install again."
 | 
						|
            read -n 1 -s -r -p $"To close the Window press a button"
 | 
						|
            clear
 | 
						|
            exit 0
 | 
						|
 | 
						|
        fi
 | 
						|
 | 
						|
elif grep -i '|manjaro\|garuda\|endeavour|' /etc/os-release > /dev/null 2>&1
 | 
						|
    then
 | 
						|
        install_arch_d
 | 
						|
 | 
						|
 | 
						|
elif grep -i 'fedora' /etc/os-release > /dev/null 2>&1
 | 
						|
    then
 | 
						|
        if ! which python3-tkinter &> /dev/null
 | 
						|
            then sudo dnf install python3-tkinter -y
 | 
						|
 | 
						|
                sudo cp -u wg_main.py start_wg.py cls_mth_fc.py && \
 | 
						|
                sudo mkdir -p /etc/wire_py && sudo touch /etc/wire_py/keys && \
 | 
						|
                sudo cp -u settings /etc/wire_py/ && \
 | 
						|
                sudo cp -u languages/de/*.mo /usr/share/locale/de/LC_MESSAGES/ && \
 | 
						|
                sudo cp -uR wp-icons lx-icons /usr/share/icons/ && sudo cp -uR TK-Themes /usr/share/ && \
 | 
						|
                sudo chown -R root:root /etc/wire_py && sudo chmod 755 /etc/wire_py && \
 | 
						|
                sudo ln -sf /usr/bin/wirepy.py /usr/local/bin/wirepy && \
 | 
						|
                sudo cp -u org.wirepy.policy /usr/share/polkit-1/actions/ && \
 | 
						|
                sudo cp -u Wire-Py.desktop /usr/share/applications/ && \
 | 
						|
                sudo cp -u wg_start.service /lib/systemd/system/ && \
 | 
						|
                sudo systemctl enable wg_start.service
 | 
						|
 | 
						|
        fi
 | 
						|
elif grep -i 'suse' /etc/os-release > /dev/null 2>&1
 | 
						|
    then
 | 
						|
        if ! which python311-tk &> /dev/null
 | 
						|
            then sudo zypper install python311-tk
 | 
						|
                 sudo cp -u wg_main.py start_wg.py cls_mth_fc.py && \
 | 
						|
                 sudo mkdir -p /etc/wire_py && sudo touch /etc/wire_py/keys && \
 | 
						|
                 sudo cp -u settings /etc/wire_py/ && \
 | 
						|
                 sudo cp -u languages/de/*.mo /usr/share/locale/de/LC_MESSAGES/ && \
 | 
						|
                 sudo cp -uR wp-icons lx-icons /usr/share/icons/ && sudo cp -uR TK-Themes /usr/share/ && \
 | 
						|
                 sudo chown -R root:root /etc/wire_py && sudo chmod 755 /etc/wire_py && \
 | 
						|
                 sudo ln -sf /usr/bin/wirepy.py /usr/local/bin/wirepy && \
 | 
						|
                 sudo cp -u org.wirepy.policy /usr/share/polkit-1/actions/ && \
 | 
						|
                 sudo cp -u Wire-Py.desktop /usr/share/applications/ && \
 | 
						|
                 sudo cp -u wg_start.service /lib/systemd/system/ && \
 | 
						|
                 sudo systemctl enable wg_start.service
 | 
						|
        fi
 | 
						|
else
 | 
						|
    clear
 | 
						|
    echo $"Your System could not be determined."
 | 
						|
    echo
 | 
						|
    read -n 1 -s -r -p $"To close the window press a button"
 | 
						|
    clear
 | 
						|
    exit 0
 | 
						|
fi
 | 
						|
clear
 | 
						|
read -n 1 -s -r -p $"To close the Window press a button"
 | 
						|
clear
 | 
						|
 | 
						|
 |