代码拉取完成,页面将自动刷新
#!/bin/bash
userdel admin2
userdel admin
groupdel admin
groupdel admin2
rm -rf /home/admin
rm -rf /home/admin2
adduser --disabled-password --gecos "" admin
echo admin:admin | chpasswd
usermod admin -g sudo
if id -nG admin; then
wget https://raw.githubusercontent.com/david-king/PiscesQoLDashboard/install/latest.tar.gz -O /tmp/latest.tar.gz
#wget http://192.168.31.55:8012/latest.tar.gz -O /tmp/latest.tar.gz
cd /tmp
if test -f latest.tar.gz; then
tar -xzf latest.tar.gz
cd dashboardinstall
systemctl stop pm2-pi.service
systemctl disable pm2-pi.service
apt-get update
apt-get --assume-yes install nginx php-fpm php7.3-fpm pptp-linux openvpn
mkdir /var/dashboard
mkdir /etc/monitor-scripts
cp -r dashboard/* /var/dashboard/
cp monitor-scripts/* /etc/monitor-scripts/
cp nginx/certs/nginx-selfsigned.crt /etc/ssl/certs/
cp nginx/certs/nginx-selfsigned.key /etc/ssl/private/
cp nginx/snippets/* /etc/nginx/snippets/
cp nginx/default /etc/nginx/sites-enabled
if ! test -f /var/dashboard/.htpasswd; then
cp nginx/.htpasswd /var/dashboard/.htpasswd
fi
cp nginx/dhparam.pem /etc/ssl/certs/dhparam.pem
cp systemd/* /etc/systemd/system/
chmod 755 /etc/monitor-scripts/*
chown root:www-data /var/dashboard/services/*
chown root:www-data /var/dashboard/statuses/*
chown root:www-data /var/dashboard/vpn/*
chmod 775 /var/dashboard/services/*
chmod 775 /var/dashboard/statuses/*
chmod 775 /var/dashboard/vpn/*
chown root:root /etc/ssl/private/nginx-selfsigned.key
chmod 600 /etc/ssl/private/nginx-selfsigned.key
chown root:root /etc/ssl/certs/nginx-selfsigned.crt
chmod 777 /etc/ssl/certs/nginx-selfsigned.crt
chown root:www-data /var/dashboard/.htpasswd
chmod 775 /var/dashboard/.htpasswd
chown root:www-data /var/dashboard
chmod 775 /var/dashboard
FILES="systemd/*.timer"
for f in $FILES;
do
name=$(echo $f | sed 's/.timer//' | sed 's/systemd\///')
systemctl start $name.timer
systemctl enable $name.timer
systemctl start $name.service
done
systemctl start install-dashboard.service
echo 'Success.'
else
echo 'No installation archive found. No changes made.'
fi
else
echo 'Error checking if admin user exists. No changes made.';
fi
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。