melonvpn-original-cs/install-dependencies

30 lines
779 B
Bash
Executable File

#!/bin/bash
# Check if golang exists by the output of "go version"
if [ "$(go version | head -c 13)" == "go version go" ]; then
echo "Assuming go is installed"
# Check location for simple vpn binary
if [ -f /usr/bin/simple-vpn ]; then
echo "Found \"/usr/bin/simple-vpn\" assuming it is installed correctly"
else
# Clone github repo
echo "Cloning simple-vpn"
git clone https://codehub.onpointcoding.net/sean/simple-vpn.git
cd simple-vpn
# Build and copy binary to bin directory
echo "Installing simple-vpn"
go build
sudo cp ./simple-vpn /usr/bin/ -i
cd ..
# Remove repository
echo "Cleaning up"
rm simple-vpn -rf
echo "Components installed..."
fi
else
echo "Please install golang before continuing"
exit
fi