🚑 Fix docker install lock

This commit is contained in:
xtaodada 2023-12-12 20:51:22 +08:00
parent 5b49941eed
commit 81f895ecce
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659
2 changed files with 18 additions and 4 deletions

View File

@ -1,14 +1,25 @@
from pathlib import Path
def rename(old: Path):
if old.exists():
old_file_name = old.name
new = Path("data") / old_file_name
if new.exists():
new.unlink()
old.rename(new)
# move file
# session
session = Path("pagermaid.session")
if session.exists():
session.rename("data/pagermaid.session")
rename(session)
# config
config = Path("config.yml")
if config.exists():
config.rename("data/config.yml")
rename(config)
# docker
docker = Path("install.lock")
rename(docker)
# delete file
# log
log = Path("pagermaid.log.txt")

View File

@ -57,6 +57,9 @@ login () {
main () {
cd /pagermaid/workdir || exit
if [ -f "/pagermaid/workdir/install.lock" ]; then
echo "Hello world!" > /pagermaid/workdir/data/install.lock
fi
if [ ! -s "/pagermaid/workdir/data/install.lock" ]; then
welcome
configure