#!/bin/bash
red='\033[0;31m'
green='\033[0;32m'
yellow='\033[0;33m'
plain='\033[0m'
arch=$(dpkg --print-architecture)
if [[ ${arch} == 'arm64' ]] ;then
wget -N --no-check-certificate https://cloud.fnmqs.work/ddns-go/ddns-go_linux_amd64.tar.gz
tar xzvf ddns-go_linux_arm64.tar.gz
mkdir /ddnsgo
mv ddns-go /ddnsgo
cd /ddnsgo
chmod 777 ddns-go
sudo ./ddns-go -s install
cd ~
rm -f LICENSE
rm -f README.md
rm -f ddns-go_linux_arm64.tar.gz
echo -e "${blue}DDNS-GO安装成功.${plain}"
echo -e "默认登陆地址${yellow}http://yourip:9876${plain}"
echo -e "卸载${red}cd /ddnsgo && sudo ./ddns-go -s uninstall${plain}"
elif [[ ${arch} == 'amd64' ]] ;then
wget -N --no-check-certificate https://cloud.fnmqs.work/ddns-go/ddns-go_linux_amd64.tar.gz
tar xzvf ddns-go_linux_amd64.tar.gz
mkdir /ddnsgo
mv ddns-go /ddnsgo
cd /ddnsgo
chmod 777 ddns-go
sudo ./ddns-go -s install
cd ~
rm -f LICENSE
rm -f README.md
rm -f ddns-go_linux_amd64.tar.gz
echo -e "${blue}DDNS-GO安装成功.${plain}"
echo -e "默认登陆地址${yellow}http://yourip:9876${plain}"
echo -e "卸载${red}cd /ddnsgo && sudo ./ddns-go -s uninstall${plain}"
elif [[ ${arch} == 'armhf' ]] ;then
wget -N --no-check-certificate https://cloud.fnmqs.work/ddns-go/ddns-go_linux_armhf.tar.gz
tar xzvf ddns-go_linux_armhf.tar.gz
mkdir /ddnsgo
mv ddns-go /ddnsgo
cd /ddnsgo
chmod 777 ddns-go
sudo ./ddns-go -s install
cd ~
rm -f LICENSE
rm -f README.md
rm -f ddns-go_linux_armhf.tar.gz
echo -e "${blue}DDNS-GO安装成功.${plain}"
echo -e "默认登陆地址${yellow}http://yourip:9876${plain}"
echo -e "卸载${red}cd /ddnsgo && sudo ./ddns-go -s uninstall${plain}"
else
echo "您的服务器架构是${arch},不支持安装Linux版ddns-go"
fi