mirror of
https://github.com/andrey271192/PCAtelegram_web.git
synced 2026-09-20 11:55:32 +00:00
feat: add Mieru management
This commit is contained in:
@@ -47,6 +47,12 @@ create_backup() {
|
||||
if [ -f "$PCATELEGRAM_WEB_DIR/warp.json" ]; then
|
||||
cp "$PCATELEGRAM_WEB_DIR/warp.json" "$tmp_dir/warp.json" 2>/dev/null
|
||||
fi
|
||||
if [ -f "$PCATELEGRAM_WEB_DIR/mieru.json" ]; then
|
||||
cp "$PCATELEGRAM_WEB_DIR/mieru.json" "$tmp_dir/mieru.json" 2>/dev/null
|
||||
fi
|
||||
if [ -f "$PCATELEGRAM_WEB_DIR/mieru_server_config.json" ]; then
|
||||
cp "$PCATELEGRAM_WEB_DIR/mieru_server_config.json" "$tmp_dir/mieru_server_config.json" 2>/dev/null
|
||||
fi
|
||||
|
||||
# Language marker (i18n)
|
||||
if [ -f "$PCATELEGRAM_WEB_DIR/.language" ]; then
|
||||
@@ -253,6 +259,12 @@ restore_backup() {
|
||||
if [ ! -f "$backup_dir/warp.json" ] && [ -f "$tmp_dir/opt/pcatelegram_web/warp.json" ]; then
|
||||
cp "$tmp_dir/opt/pcatelegram_web/warp.json" "$backup_dir/warp.json" 2>/dev/null || true
|
||||
fi
|
||||
if [ ! -f "$backup_dir/mieru.json" ] && [ -f "$tmp_dir/opt/pcatelegram_web/mieru.json" ]; then
|
||||
cp "$tmp_dir/opt/pcatelegram_web/mieru.json" "$backup_dir/mieru.json" 2>/dev/null || true
|
||||
fi
|
||||
if [ ! -f "$backup_dir/mieru_server_config.json" ] && [ -f "$tmp_dir/opt/pcatelegram_web/mieru_server_config.json" ]; then
|
||||
cp "$tmp_dir/opt/pcatelegram_web/mieru_server_config.json" "$backup_dir/mieru_server_config.json" 2>/dev/null || true
|
||||
fi
|
||||
|
||||
# Проверяем метаданные
|
||||
if [ -f "$backup_dir/metadata.json" ]; then
|
||||
@@ -314,6 +326,16 @@ restore_backup() {
|
||||
cp "$backup_dir/warp.json" "$PCATELEGRAM_WEB_DIR/warp.json" 2>/dev/null
|
||||
chmod 600 "$PCATELEGRAM_WEB_DIR/warp.json" 2>/dev/null || true
|
||||
fi
|
||||
if [ -f "$backup_dir/mieru.json" ]; then
|
||||
mkdir -p "$PCATELEGRAM_WEB_DIR"
|
||||
cp "$backup_dir/mieru.json" "$PCATELEGRAM_WEB_DIR/mieru.json" 2>/dev/null
|
||||
chmod 600 "$PCATELEGRAM_WEB_DIR/mieru.json" 2>/dev/null || true
|
||||
fi
|
||||
if [ -f "$backup_dir/mieru_server_config.json" ]; then
|
||||
mkdir -p "$PCATELEGRAM_WEB_DIR"
|
||||
cp "$backup_dir/mieru_server_config.json" "$PCATELEGRAM_WEB_DIR/mieru_server_config.json" 2>/dev/null
|
||||
chmod 600 "$PCATELEGRAM_WEB_DIR/mieru_server_config.json" 2>/dev/null || true
|
||||
fi
|
||||
|
||||
# Восстанавливаем language marker (i18n)
|
||||
if [ -f "$backup_dir/.language" ]; then
|
||||
|
||||
Reference in New Issue
Block a user