mirror of
https://github.com/TeamPGM/PagerMaid-Pyro.git
synced 2024-11-27 08:56:17 +00:00
🚑 Fix docker install lock
This commit is contained in:
parent
5b49941eed
commit
81f895ecce
@ -1,14 +1,25 @@
|
|||||||
from pathlib import Path
|
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
|
# move file
|
||||||
# session
|
# session
|
||||||
session = Path("pagermaid.session")
|
session = Path("pagermaid.session")
|
||||||
if session.exists():
|
rename(session)
|
||||||
session.rename("data/pagermaid.session")
|
|
||||||
# config
|
# config
|
||||||
config = Path("config.yml")
|
config = Path("config.yml")
|
||||||
if config.exists():
|
rename(config)
|
||||||
config.rename("data/config.yml")
|
# docker
|
||||||
|
docker = Path("install.lock")
|
||||||
|
rename(docker)
|
||||||
# delete file
|
# delete file
|
||||||
# log
|
# log
|
||||||
log = Path("pagermaid.log.txt")
|
log = Path("pagermaid.log.txt")
|
||||||
|
@ -57,6 +57,9 @@ login () {
|
|||||||
|
|
||||||
main () {
|
main () {
|
||||||
cd /pagermaid/workdir || exit
|
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
|
if [ ! -s "/pagermaid/workdir/data/install.lock" ]; then
|
||||||
welcome
|
welcome
|
||||||
configure
|
configure
|
||||||
|
Loading…
Reference in New Issue
Block a user