docs: 优化多个 README 文件中的命令格式
- 移除了不必要的 mkdir 命令中的 && 符号 - 更新了 curl 命令格式,从 -fsSL 改为 -fSL - 添加了 Python 脚本说明文档 - 新增了删除空文件夹的 Python 脚本
This commit is contained in:
@@ -5,13 +5,13 @@
|
||||
1. 创建一些文件夹
|
||||
|
||||
```bash
|
||||
mkdir -p /opt/docker/adguardhome/data/work && mkdir -p /opt/docker/adguardhome/data/conf && cd /opt/docker/adguardhome
|
||||
mkdir -p /opt/docker/adguardhome/data/work && cd /opt/docker/adguardhome
|
||||
```
|
||||
|
||||
2. 下载 docker-compose.yml
|
||||
|
||||
```bash
|
||||
curl -fsSL https://i.sugarscat.cn/me/script/-/raw/main/docker/compose/adguardhome/docker-compose.yml > docker-compose.yml
|
||||
curl -fSL https://i.sugarscat.cn/me/script/-/raw/main/docker/compose/adguardhome/docker-compose.yml > docker-compose.yml
|
||||
```
|
||||
|
||||
## docker-compose 部署
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
创建一些文件夹
|
||||
|
||||
```bash
|
||||
mkdir -p /opt/docker/clash && mkdir -p /opt/docker/clash/data && cd /opt/docker/clash
|
||||
mkdir -p /opt/docker/clash && cd /opt/docker/clash
|
||||
```
|
||||
|
||||
**请在 `data` 文件夹下创建 `config.yaml` 文件**
|
||||
@@ -11,7 +11,7 @@ mkdir -p /opt/docker/clash && mkdir -p /opt/docker/clash/data && cd /opt/docker/
|
||||
下载 docker-compose.yml
|
||||
|
||||
```bash
|
||||
curl -fsSL https://i.sugarscat.cn/me/script/-/raw/main/docker/compose/clash/docker-compose.yml > docker-compose.yml
|
||||
curl -fSL https://i.sugarscat.cn/me/script/-/raw/main/docker/compose/clash/docker-compose.yml > docker-compose.yml
|
||||
```
|
||||
|
||||
启动
|
||||
|
||||
@@ -11,13 +11,13 @@
|
||||
2. 下载 docker-compose.yml
|
||||
|
||||
```bash
|
||||
curl -fsSL https://i.sugarscat.cn/me/script/-/raw/main/docker/compose/frpc/docker-compose.yml > docker-compose.yml
|
||||
curl -fSL https://i.sugarscat.cn/me/script/-/raw/main/docker/compose/frpc/docker-compose.yml > docker-compose.yml
|
||||
```
|
||||
|
||||
3. 下载配置
|
||||
|
||||
```bash
|
||||
curl -fsSL https://i.sugarscat.cn/me/script/-/raw/main/docker/compose/frpc/frpc.toml > data/frpc.toml
|
||||
curl -fSL https://i.sugarscat.cn/me/script/-/raw/main/docker/compose/frpc/frpc.toml > data/frpc.toml
|
||||
```
|
||||
|
||||
## docker-compose 部署
|
||||
|
||||
@@ -11,13 +11,13 @@
|
||||
2. 下载 docker-compose.yml
|
||||
|
||||
```bash
|
||||
curl -fsSL https://i.sugarscat.cn/me/script/-/raw/main/docker/compose/frps/docker-compose.yml > docker-compose.yml
|
||||
curl -fSL https://i.sugarscat.cn/me/script/-/raw/main/docker/compose/frps/docker-compose.yml > docker-compose.yml
|
||||
```
|
||||
|
||||
3. 下载配置
|
||||
|
||||
```bash
|
||||
curl -fsSL https://i.sugarscat.cn/me/script/-/raw/main/docker/compose/frps/frps.toml > data/frps.toml
|
||||
curl -fSL https://i.sugarscat.cn/me/script/-/raw/main/docker/compose/frps/frps.toml > data/frps.toml
|
||||
```
|
||||
|
||||
## docker-compose 部署
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
1. 创建一些文件夹
|
||||
|
||||
```bash
|
||||
mkdir -p /opt/docker/gitlab-ce/data/etc && mkdir -p /opt/docker/gitlab-ce/data/opt && mkdir -p /opt/docker/gitlab-ce/data/log && cd /opt/docker/gitlab-ce
|
||||
mkdir -p /opt/docker/gitlab-ce && cd /opt/docker/gitlab-ce
|
||||
```
|
||||
|
||||
2. 下载 docker-compose.yml
|
||||
|
||||
```bash
|
||||
curl -fsSL https://i.sugarscat.cn/me/script/-/raw/main/docker/compose/gitlab-ce/docker-compose.yml > docker-compose.yml
|
||||
curl -fSL https://i.sugarscat.cn/me/script/-/raw/main/docker/compose/gitlab-ce/docker-compose.yml > docker-compose.yml
|
||||
```
|
||||
|
||||
## docker-compose 部署
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
1. 创建一些文件夹
|
||||
|
||||
```bash
|
||||
mkdir -p /opt/docker/rustdesk && mkdir -p /opt/docker/rustdesk/data/hbbs && cd /opt/docker/rustdesk
|
||||
mkdir -p /opt/docker/rustdesk && cd /opt/docker/rustdesk
|
||||
```
|
||||
|
||||
1. 下载 docker-compose.yml
|
||||
|
||||
```bash
|
||||
curl -fsSL https://i.sugarscat.cn/me/script/-/raw/main/docker/compose/rustdesk/docker-compose.yml > docker-compose.yml
|
||||
curl -fSL https://i.sugarscat.cn/me/script/-/raw/main/docker/compose/rustdesk/docker-compose.yml > docker-compose.yml
|
||||
```
|
||||
|
||||
## docker-compose 部署
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
1. 创建一些文件夹
|
||||
|
||||
```bash
|
||||
mkdir -p /opt/docker/vaultwarden && mkdir -p /opt/docker/vaultwarden/data && cd /opt/docker/vaultwarden
|
||||
mkdir -p /opt/docker/vaultwarden && cd /opt/docker/vaultwarden
|
||||
```
|
||||
|
||||
1. 下载 docker-compose.yml
|
||||
|
||||
```bash
|
||||
curl -fsSL https://i.sugarscat.cn/me/script/-/raw/main/docker/compose/vaultwarden/docker-compose.yml > docker-compose.yml
|
||||
curl -fSL https://i.sugarscat.cn/me/script/-/raw/main/docker/compose/vaultwarden/docker-compose.yml > docker-compose.yml
|
||||
```
|
||||
|
||||
## docker-compose 部署
|
||||
|
||||
@@ -9,11 +9,11 @@ mkdir -p /var/www/37point2.cn
|
||||
下载配置
|
||||
|
||||
```bash
|
||||
curl -fsSL https://i.sugarscat.cn/me/script/-/raw/main/nginx/37point2.cn/index.html > /var/www/37point2.cn/index.html
|
||||
curl -fSL https://i.sugarscat.cn/me/script/-/raw/main/nginx/37point2.cn/index.html > /var/www/37point2.cn/index.html
|
||||
```
|
||||
|
||||
```bash
|
||||
curl -fsSL https://i.sugarscat.cn/me/script/-/raw/main/nginx/37point2.cn/nginx.conf > /etc/nginx/sites-available/37point2.cn
|
||||
curl -fSL https://i.sugarscat.cn/me/script/-/raw/main/nginx/37point2.cn/nginx.conf > /etc/nginx/sites-available/37point2.cn
|
||||
```
|
||||
|
||||
启用配置
|
||||
|
||||
@@ -31,7 +31,7 @@ systemctl status nginx
|
||||
下载配置
|
||||
|
||||
```bash
|
||||
curl -fsSL https://i.sugarscat.cn/me/script/-/raw/main/nginx/nginx.conf > /etc/nginx/nginx.conf
|
||||
curl -fSL https://i.sugarscat.cn/me/script/-/raw/main/nginx/nginx.conf > /etc/nginx/nginx.conf
|
||||
```
|
||||
|
||||
测试配置
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
下载配置
|
||||
|
||||
```bash
|
||||
curl -fsSL https://i.sugarscat.cn/me/script/-/raw/main/nginx/example/nginx.conf > /etc/nginx/sites-available/example.com
|
||||
curl -fSL https://i.sugarscat.cn/me/script/-/raw/main/nginx/example/nginx.conf > /etc/nginx/sites-available/example.com
|
||||
```
|
||||
|
||||
启用配置
|
||||
|
||||
@@ -7,7 +7,7 @@ mkdir -p /opt/www/note && cd /opt/www/note
|
||||
```
|
||||
|
||||
```bash
|
||||
curl -fsSL https://i.sugarscat.cn/me/script/-/raw/main/nginx/note.sugarscat.cn/deploy.sh > deploy.sh && chmod +x deploy.sh
|
||||
curl -fSL https://i.sugarscat.cn/me/script/-/raw/main/nginx/note.sugarscat.cn/deploy.sh > deploy.sh && chmod +x deploy.sh
|
||||
```
|
||||
|
||||
## 定时执行脚本
|
||||
@@ -35,7 +35,7 @@ crontab -l
|
||||
下载配置
|
||||
|
||||
```bash
|
||||
curl -fsSL https://i.sugarscat.cn/me/script/-/raw/main/nginx/note.sugarscat.cn/nginx.conf > /etc/nginx/sites-available/note.sugarscat.cn
|
||||
curl -fSL https://i.sugarscat.cn/me/script/-/raw/main/nginx/note.sugarscat.cn/nginx.conf > /etc/nginx/sites-available/note.sugarscat.cn
|
||||
```
|
||||
|
||||
启用配置
|
||||
|
||||
15
python/README.md
Normal file
15
python/README.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# Python 脚本说明
|
||||
|
||||
## 删除空的文件夹
|
||||
|
||||
1. 下载脚本:
|
||||
|
||||
```bash
|
||||
curl -O https://i.sugarscat.cn/me/script/-/raw/main/python/delete_empty_folders.py
|
||||
```
|
||||
|
||||
2. 执行下载的脚本:
|
||||
|
||||
```bash
|
||||
python delete_empty_folders.py
|
||||
```
|
||||
17
python/delete_empty_folders.py
Normal file
17
python/delete_empty_folders.py
Normal file
@@ -0,0 +1,17 @@
|
||||
import os
|
||||
|
||||
def delete_empty_folders(path='.'):
|
||||
# 倒序遍历所有文件夹,确保从最深层开始删除
|
||||
for root, dirs, files in os.walk(path, topdown=False):
|
||||
for dir_name in dirs:
|
||||
full_path = os.path.join(root, dir_name)
|
||||
try:
|
||||
# 检查是否为空文件夹
|
||||
if not os.listdir(full_path):
|
||||
os.rmdir(full_path)
|
||||
print(f"✅ 成功删除空文件夹: {full_path}")
|
||||
except Exception as e:
|
||||
print(f"❌ 无法删除: {full_path},错误: {e}")
|
||||
|
||||
if __name__ == "__main__":
|
||||
delete_empty_folders()
|
||||
Reference in New Issue
Block a user