#!/bin/bash
red='33[0;31m'
green='33[0;32m'
yellow='33[0;33m'
plain='33[0m'
arch=$(dpkg --print-architecture)
if [[ ${arch} == 'arm64' ]] ;then
#脚本内容
mkdir /alist
cd /alist
wget -N --no-check-certificate https://cloud.fnmqs.work/Alist/alist-linux-arm64.tar.gz
tar -zxvf alist-linux-arm64.tar.gz
chmod 777 alist
cd
wget -N --no-check-certificate https://cloud.fnmqs.work/Alist/alist.service -O alist.service
mv alist.service /etc/systemd/system
systemctl daemon-reload
systemctl enable alist
echo -e "${yellow}已设置开机启动${plain}"
systemctl start alist
echo -e "${yellow}alist已开启${plain}"
systemctl restart alist
echo -e "输入${yellow}cd /alist && ./alist admin${plain}查看默认密码"
echo -e "默认登陆地址${yellow}http://yourip:5244${plain}"
elif [[ ${arch} == 'amd64' ]] ;then
#脚本内容
mkdir /alist
cd /alist
wget -N --no-check-certificate https://cloud.fnmqs.work/Alist/alist-linux-amd64.tar.gz
tar -zxvf alist-linux-amd64.tar.gz
chmod 777 alist
cd
wget -N --no-check-certificate https://cloud.fnmqs.work/Alist/alist.service -O alist.service
mv alist.service /etc/systemd/system
systemctl daemon-reload
systemctl enable alist
echo -e "${yellow}已设置开机启动${plain}"
systemctl start alist
echo -e "${yellow}alist已开启${plain}"
systemctl restart alist
echo -e "输入${yellow}cd /alist && ./alist admin${plain}查看默认密码"
echo -e "默认登陆地址${yellow}http://yourip:5244${plain}"
elif [[ ${arch} == 'armhf' ]] ;then
#脚本内容
mkdir /alist
cd /alist
wget -N --no-check-certificate https://cloud.fnmqs.work/Alist/alist/v3.30.0/alist-linux-armhf.tar.gz
tar -zxvf alist-linux-armhf.tar.gz
chmod 777 alist
cd
wget -N --no-check-certificate https://cloud.fnmqs.work/Alist/alist.service -O alist.service
mv alist.service /etc/systemd/system
systemctl daemon-reload
systemctl enable alist
echo -e "${yellow}已设置开机启动${plain}"
systemctl start alist
echo -e "${yellow}alist已开启${plain}"
systemctl restart alist
echo -e "输入${yellow}cd /alist && ./alist admin${plain}查看默认密码"
echo -e "默认登陆地址${yellow}http://yourip:5244${plain}"
else
echo "您的服务器架构是${arch},不支持安装alist"
fi