更新ssh脚本,优化备份脚本,删除nginx证书链接
This commit is contained in:
parent
9298d47d00
commit
ccd83b9200
@ -13,14 +13,12 @@ for item in "$web_path"/*; do
|
|||||||
# 切换到网站目录进行压缩
|
# 切换到网站目录进行压缩
|
||||||
cd "$item" || exit
|
cd "$item" || exit
|
||||||
zip -r "${item_name}_${date_time}.zip" .
|
zip -r "${item_name}_${date_time}.zip" .
|
||||||
# 移动压缩文件回原始目录
|
|
||||||
mv "${item_name}_${date_time}.zip" "$original_dir"
|
|
||||||
# 返回原始目录
|
|
||||||
cd "$original_dir" || exit
|
|
||||||
# 上传到百度网盘存储
|
# 上传到百度网盘存储
|
||||||
bypy upload "${item_name}_${date_time}.zip" "/${item_name}/"
|
bypy upload "${item_name}_${date_time}.zip" "/${item_name}/"
|
||||||
# 上传到阿里云盘
|
# 上传到阿里云盘
|
||||||
aliyunpan upload "${item_name}_${date_time}.zip" "/网站/${item_name}/${year}/"
|
aliyunpan upload "${item_name}_${date_time}.zip" "/网站/${item_name}/${year}/"
|
||||||
# 删除文件
|
# 删除文件
|
||||||
rm "${item_name}_${date_time}.zip"
|
rm "${item_name}_${date_time}.zip"
|
||||||
|
# 返回原始目录
|
||||||
|
cd "$original_dir" || exit
|
||||||
done
|
done
|
@ -1,6 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
for file in /etc/nginx/sites-available/*;do
|
|
||||||
base=$(basename "$file")
|
|
||||||
ln -s "$file" "/etc/nginx/sites-enabled"
|
|
||||||
done
|
|
@ -45,7 +45,7 @@ install_key(){
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
systemctl restart sshd.service
|
sudo systemctl restart sshd.service
|
||||||
|
|
||||||
echo "密钥安装完成"
|
echo "密钥安装完成"
|
||||||
}
|
}
|
||||||
@ -132,9 +132,9 @@ alter_port() {
|
|||||||
echo "端口已经修改为$port_number,记得防火墙放行"
|
echo "端口已经修改为$port_number,记得防火墙放行"
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ "$(id -u)" != "0" ]; then
|
if not command -v sudo &> /dev/null
|
||||||
echo "该脚本必须以root权限运行" 1>&2
|
then
|
||||||
exit 1
|
echo "sudo 未安装"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
while true
|
while true
|
||||||
|
Loading…
Reference in New Issue
Block a user