diff --git a/shell/code/backups/backups_file_mysql_cloud_docker.sh b/shell/code/backups/backups_file_mysql_cloud_docker.sh index 1a0c9f6..20e0b7c 100644 --- a/shell/code/backups/backups_file_mysql_cloud_docker.sh +++ b/shell/code/backups/backups_file_mysql_cloud_docker.sh @@ -13,14 +13,12 @@ for item in "$web_path"/*; do # 切换到网站目录进行压缩 cd "$item" || exit 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}/" # 上传到阿里云盘 aliyunpan upload "${item_name}_${date_time}.zip" "/网站/${item_name}/${year}/" # 删除文件 rm "${item_name}_${date_time}.zip" + # 返回原始目录 + cd "$original_dir" || exit done \ No newline at end of file diff --git a/shell/code/ng_ln.sh b/shell/code/ng_ln.sh deleted file mode 100644 index cbda5b5..0000000 --- a/shell/code/ng_ln.sh +++ /dev/null @@ -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 diff --git a/shell/code/ssh.sh b/shell/code/ssh.sh index 08f00b8..199fde1 100644 --- a/shell/code/ssh.sh +++ b/shell/code/ssh.sh @@ -45,7 +45,7 @@ install_key(){ fi - systemctl restart sshd.service + sudo systemctl restart sshd.service echo "密钥安装完成" } @@ -132,10 +132,10 @@ alter_port() { echo "端口已经修改为$port_number,记得防火墙放行" } -if [ "$(id -u)" != "0" ]; then - echo "该脚本必须以root权限运行" 1>&2 - exit 1 -fi +if not command -v sudo &> /dev/null +then + echo "sudo 未安装" +fi while true do