Update shm_actions_script.sh

This commit is contained in:
Bkeenke 2024-02-25 23:41:50 +03:00 committed by GitHub
parent 9c0b5918e9
commit a57030d998
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -20,18 +20,6 @@ case $EVENT in
if [ -z $SERVER_HOST ]; then if [ -z $SERVER_HOST ]; then
SERVER_HOST="{{ server.settings.host }}" SERVER_HOST="{{ server.settings.host }}"
fi fi
echo "Install required packages"
apt update >> /dev/nul
apt install -y \
iproute2 \
iptables \
curl \
wget \
git \
build-essential \
make
echo "Check domain: $API_URL" echo "Check domain: $API_URL"
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" $API_URL/shm/v1/test) HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" $API_URL/shm/v1/test)
if [ $HTTP_CODE -ne '200' ]; then if [ $HTTP_CODE -ne '200' ]; then
@ -39,48 +27,6 @@ case $EVENT in
echo "Got status: $HTTP_CODE" echo "Got status: $HTTP_CODE"
exit 1 exit 1
fi fi
echo "Install Golang"
if ! command -v go &> /dev/null; then
echo "Install"
mkdir -p /opt/go
cd /opt/go
wget -q https://go.dev/dl/go1.22.0.linux-amd64.tar.gz
rm -rf /usr/local/go && tar -C /usr/local -xzf go1.22.0.linux-amd64.tar.gz
echo "export PATH=$PATH:/usr/local/go/bin" >> /etc/profile
source /etc/profile
source $HOME/.bashrc
if [[ "$SHELL" == "zsh" ]]; then
source $HOME/.zshrc
fi
else
echo "Golang installed"
fi
echo "Install Amnezia-Go"
if test -d /opt/amnezia-go; then
cd /opt/amnezia-go
make >> /dev/null
echo "installed"
else
echo "install"
git clone https://github.com/amnezia-vpn/amneziawg-go.git /opt/amnezia-go >> /dev/null
cd /opt/amnezia-go
make >> /dev/null
cp /opt/amnezia-go/amneziawg-go /usr/bin/amneziawg-go
fi
echo "Install Amnezia-tools"
if test -d /opt/amnezia-tools; then
cd /opt/amnezia-tools/src
make >> /dev/null
make install
echo "installed"
else
echo "install"
git clone https://github.com/amnezia-vpn/amneziawg-tools.git /opt/amnezia-tools >> /dev/null
cd /opt/amnezia-tools/src
make >> /dev/null
make install
fi
echo echo
echo "Download awg-manager.sh" echo "Download awg-manager.sh"
mkdir -p /etc/amnezia/amneziawg mkdir -p /etc/amnezia/amneziawg