melonvpn-original-cs/install-dependencies

30 lines
779 B
Plaintext
Raw Normal View History

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