Skip to content

Commit f2058e7

Browse files
committed
chore: update comments in init_db.sh
Signed-off-by: Xin Liu <sam@secondstate.io>
1 parent 58ad08b commit f2058e7

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

init_db.sh

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,51 @@
11
#!/bin/bash
22

3-
# ss-proxy 数据库初始化脚本
4-
# 用途:执行 SQL 脚本创建数据库表结构
3+
# ss-proxy database initialization script
4+
# Purpose: Execute SQL scripts to create database table structure
55

6-
set -e # 遇到错误立即退出
6+
set -e # Exit immediately on error
77

8-
# 默认数据库路径
8+
# Default database path
99
DB_PATH="${1:-./sessions.db}"
1010

1111
echo "================================================"
12-
echo " ss-proxy 数据库初始化工具"
12+
echo " ss-proxy Database Initialization Tool"
1313
echo "================================================"
1414
echo ""
15-
echo "数据库路径: $DB_PATH"
15+
echo "Database path: $DB_PATH"
1616
echo ""
1717

18-
# 检查 sqlite3 是否安装
18+
# Check if sqlite3 is installed
1919
if ! command -v sqlite3 &> /dev/null; then
20-
echo "错误: 未找到 sqlite3 命令"
21-
echo "请先安装 SQLite: brew install sqlite"
20+
echo "Error: sqlite3 command not found"
21+
echo "Please install SQLite first: brew install sqlite"
2222
exit 1
2323
fi
2424

25-
# 检查 SQL 脚本是否存在
25+
# Check if SQL script exists
2626
if [ ! -f "migrations/init.sql" ]; then
27-
echo "错误: 未找到 migrations/init.sql 文件"
27+
echo "Error: migrations/init.sql file not found"
2828
exit 1
2929
fi
3030

31-
# 执行 SQL 脚本
32-
echo "正在执行初始化脚本..."
31+
# Execute SQL script
32+
echo "Executing initialization script..."
3333
if sqlite3 "$DB_PATH" < migrations/init.sql; then
3434
echo ""
3535
echo "================================================"
36-
echo "数据库初始化成功!"
36+
echo "Database initialization successful!"
3737
echo "================================================"
3838
echo ""
39-
echo "数据库位置: $DB_PATH"
39+
echo "Database location: $DB_PATH"
4040
echo ""
41-
echo "查看表结构:"
41+
echo "View table schema:"
4242
echo " sqlite3 $DB_PATH '.schema sessions'"
4343
echo ""
44-
echo "查询数据:"
44+
echo "Query data:"
4545
echo " sqlite3 $DB_PATH 'SELECT * FROM sessions;'"
4646
echo ""
4747
else
4848
echo ""
49-
echo "数据库初始化失败"
49+
echo "Database initialization failed"
5050
exit 1
5151
fi

0 commit comments

Comments
 (0)