From a57030d998da0028e06958fb4c7459b7608d67c8 Mon Sep 17 00:00:00 2001 From: Bkeenke <128972800+bkeenke@users.noreply.github.com> Date: Sun, 25 Feb 2024 23:41:50 +0300 Subject: [PATCH] Update shm_actions_script.sh --- shm_actions_script.sh | 56 +------------------------------------------ 1 file changed, 1 insertion(+), 55 deletions(-) diff --git a/shm_actions_script.sh b/shm_actions_script.sh index e8119c6..4ec4e02 100755 --- a/shm_actions_script.sh +++ b/shm_actions_script.sh @@ -20,18 +20,6 @@ case $EVENT in if [ -z $SERVER_HOST ]; then SERVER_HOST="{{ server.settings.host }}" 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" HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" $API_URL/shm/v1/test) if [ $HTTP_CODE -ne '200' ]; then @@ -39,48 +27,6 @@ case $EVENT in echo "Got status: $HTTP_CODE" exit 1 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 "Download awg-manager.sh" mkdir -p /etc/amnezia/amneziawg @@ -97,7 +43,7 @@ case $EVENT in CREATE) echo "Create new user" USER_CFG=$($AWG_MANAGER -u "{{ us.id }}" -c -p) - + echo "Upload user key to SHM" $CURL -s -XPUT \ -H "session-id: $SESSION_ID" \