fix #2
parent
815c521315
commit
ba9186b71b
159
zerotier.sh
159
zerotier.sh
|
@ -2,6 +2,22 @@
|
|||
|
||||
NOINSTALLONCURL="no"
|
||||
|
||||
|
||||
if [ ! $(whoami) = "root" ]
|
||||
then
|
||||
if [ -f "/usr/bin/dialog" ] || [ -f "/usr/sbin/dialog" ] || [ -f "/usr/games/dialog" ]
|
||||
then
|
||||
dialog --title "root" --msgbox "You need run this script as root" 0 0
|
||||
else
|
||||
echo "You need run this script as root"
|
||||
fi
|
||||
clear
|
||||
exit
|
||||
fi
|
||||
if [ -f "/usr/bin/sudo" ] || [ -f "/usr/sbin/sudo" ] || [ -f "/usr/games/sudo" ]
|
||||
then
|
||||
echo sudo
|
||||
fi
|
||||
echo "do you use sudo command?(y/n)"
|
||||
read sucommand
|
||||
if [ $sucommand = n ]
|
||||
|
@ -32,110 +48,65 @@ echo "Do you want to install zerotier-one? y/n"
|
|||
read install
|
||||
|
||||
|
||||
echo "Do you use Distros based on Debian, Ubuntu, Linux Mint, etc. (apt), y/n"
|
||||
read deb
|
||||
if [ $deb = y ]
|
||||
if [ -f "/usr/bin/apt" ] || [ -f "/usr/sbin/apt" ] || [ -f "/usr/games/apt" ]
|
||||
then
|
||||
sudo apt install curl git python3 python3-tk xterm
|
||||
echo satisfied dependencies
|
||||
echo apt detected
|
||||
apt update
|
||||
apt install curl git python3 python3-tk xterm
|
||||
xterm -e "curl -s https://install.zerotier.com | sudo bash"
|
||||
else
|
||||
if [ $deb = n ]
|
||||
if [ -f "/usr/bin/dnf" ] || [ -f "/usr/sbin/dnf" ] || [ -f "/usr/games/dnf" ]
|
||||
then
|
||||
echo "Do you use Distros based on Fedora, Red Hat, etc. (dnf), y/n"
|
||||
read dnf
|
||||
if [ $dnf = y ]
|
||||
echo dnf detected
|
||||
dnf install curl git python3 python3-tkinter xterm
|
||||
xterm -e "curl -s https://install.zerotier.com | sudo bash"
|
||||
else
|
||||
if [ -f "/usr/bin/pacman" ] || [ -f "/usr/sbin/pacman" ] || [ -f "/usr/games/pacman" ]
|
||||
then
|
||||
sudo dnf install curl git python3 python3-tkinter xterm
|
||||
echo satisfied dependencies
|
||||
echo pacman detected
|
||||
echo "WARNING: This script just works on Manjaro, no arch (Ctrl + C to cancel)"
|
||||
read
|
||||
pacman -Syy
|
||||
pacman -S zerotier-one
|
||||
pacman -S curl git python tk xterm
|
||||
else
|
||||
echo "Do you use Distros based on Arch, Manjaro, etc (pacman), y/n"
|
||||
read pacman
|
||||
if [ $pacman = y ]
|
||||
if [ -f "/usr/bin/zypper" ] || [ -f "/usr/sbin/zypper" ] || [ -f "/usr/games/zypper" ]
|
||||
then
|
||||
NOINSTALLONCURL="yes"
|
||||
|
||||
if [ $install = y ]
|
||||
then
|
||||
sudo pacman -Sy zerotier-one
|
||||
fi
|
||||
|
||||
sudo pacman -Sy curl git python tk xterm
|
||||
echo satisfied dependencies
|
||||
else
|
||||
echo "Do you use OpenSUSE Tumbleweed (Tumbleweed repo, zypper), y/n"
|
||||
read zypper
|
||||
if [ $zypper = y ]
|
||||
then
|
||||
if [ $install = y ]
|
||||
then
|
||||
sudo zypper addrepo https://download.opensuse.org/repositories/home:Dead_Mozay/openSUSE_Tumbleweed/home:Dead_Mozay.repo
|
||||
sudo zypper refresh
|
||||
sudo zypper install ZeroTierOne
|
||||
fi
|
||||
sudo zypper install curl git xterm python3 python3-tk
|
||||
echo satisfied dependencies
|
||||
NOINSTALLONCURL="yes"
|
||||
else
|
||||
echo "Do you use OpenSUSE Leap 15.3 (Leap 15.3, zypper), y/n"
|
||||
read zypper
|
||||
if [ $zypper = y ]
|
||||
then
|
||||
if [ $install = y ]
|
||||
then
|
||||
sudo zypper addrepo https://download.opensuse.org/repositories/home:Dead_Mozay/openSUSE_Leap_15.3/home:Dead_Mozay.repo
|
||||
sudo zypper refresh
|
||||
sudo zypper install ZeroTierOne
|
||||
fi
|
||||
sudo zypper install curl git xterm python3 python3-tk
|
||||
echo satisfied dependencies
|
||||
NOINSTALLONCURL="yes"
|
||||
else
|
||||
echo "Are you an OpenSUSE user and you don't use Leap 15.3 or Tumbleweed?, y/n"
|
||||
read zypper
|
||||
if [ $zypper = y ]
|
||||
then
|
||||
echo "you have to install ZeroTier in this page"
|
||||
echo "https://software.opensuse.org/package/ZeroTierOne"
|
||||
echo "if you installed ZeroTierOne, press enter to continue"
|
||||
read nothing
|
||||
sudo zypper install curl git xterm python3 python3-tk
|
||||
echo satisfied dependencies
|
||||
NOINSTALLONCURL="yes"
|
||||
else
|
||||
echo "do you want to continue without the satisfied dependencies?, y/n"
|
||||
read nodep
|
||||
if [ $nodep = n ]
|
||||
then
|
||||
echo ABORT
|
||||
exit
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
echo zypper detected
|
||||
echo "WARNING: This script just works on OpenSuse Tumbleweed, (Ctrl + C to cancel)"
|
||||
read
|
||||
zypper addrepo https://download.opensuse.org/repositories/home:Dead_Mozay/openSUSE_Tumbleweed/home:Dead_Mozay.repo
|
||||
zypper refresh
|
||||
zypper install ZeroTierOne
|
||||
zypper install curl git xterm python3 python3-tk
|
||||
fi
|
||||
fi
|
||||
else
|
||||
echo ABORT
|
||||
exit
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $install = y ]
|
||||
then
|
||||
if [ $NOINSTALLONCURL = no ]
|
||||
then
|
||||
xterm -e "curl -s https://install.zerotier.com | sudo bash"
|
||||
fi
|
||||
fi
|
||||
|
||||
# echo "Do you use OpenSUSE Leap 15.3 (Leap 15.3, zypper), y/n"
|
||||
# read zypper
|
||||
# if [ $zypper = y ]
|
||||
# then
|
||||
# if [ $install = y ]
|
||||
# then
|
||||
# sudo zypper addrepo https://download.opensuse.org/repositories/home:Dead_Mozay/openSUSE_Leap_15.3/home:Dead_Mozay.repo
|
||||
# sudo zypper refresh
|
||||
# sudo zypper install ZeroTierOne
|
||||
# fi
|
||||
# sudo zypper install curl git xterm python3 python3-tk
|
||||
# echo satisfied dependencies
|
||||
# NOINSTALLONCURL="yes"
|
||||
|
||||
echo ZeroTier installed
|
||||
|
||||
cd /opt
|
||||
sudo mkdir ZeroTierInstaller
|
||||
mkdir -p ZeroTierInstaller
|
||||
|
||||
cd /tmp
|
||||
|
||||
mkdir ZeroTierInstaller
|
||||
mkdir -p ZeroTierInstaller
|
||||
|
||||
echo temporaly ZeroTierInstaller Folder created
|
||||
|
||||
|
@ -146,26 +117,26 @@ git clone https://github.com/tralph3/ZeroTier-GUI
|
|||
echo ZeroTier-GUI by tralph3 cloned
|
||||
|
||||
|
||||
sudo cp ZeroTier-GUI/src/zerotier-gui /usr/bin/
|
||||
cp ZeroTier-GUI/src/zerotier-gui /usr/bin/
|
||||
|
||||
git clone https://github.com/Can202/ZeroTierInstaller
|
||||
cd ZeroTierInstaller/
|
||||
git checkout v0.9
|
||||
cd media/
|
||||
sudo cp zerotier-gui.png /opt/ZeroTierInstaller/
|
||||
sudo chmod a+x zerotier-exec
|
||||
sudo cp zerotier-exec /opt/ZeroTierInstaller/
|
||||
cp zerotier-gui.png /opt/ZeroTierInstaller/
|
||||
chmod a+x zerotier-exec
|
||||
cp zerotier-exec /opt/ZeroTierInstaller/
|
||||
|
||||
echo icon... done
|
||||
|
||||
sudo cp zerotier-gui.desktop /usr/share/applications/
|
||||
sudo cp zerotier-gui-sudo.desktop /usr/share/applications/
|
||||
sudo cp zerotier-gui-su.desktop /usr/share/applications/
|
||||
cp zerotier-gui.desktop /usr/share/applications/
|
||||
cp zerotier-gui-sudo.desktop /usr/share/applications/
|
||||
cp zerotier-gui-su.desktop /usr/share/applications/
|
||||
|
||||
echo app created
|
||||
|
||||
cd /tmp
|
||||
sudo rm -R ZeroTierInstaller/
|
||||
rm -vrf ZeroTierInstaller/
|
||||
echo ZeroTierInstaller Folder Removed
|
||||
|
||||
echo Ready!!!
|
||||
|
|
Loading…
Reference in New Issue