From dfa21385f381cd2b21b37f5b6f1a6ce8c7dde8b5 Mon Sep 17 00:00:00 2001 From: Morgan Jeon Date: Tue, 10 Oct 2023 00:09:29 +0900 Subject: [PATCH] removed test things --- pub/form.html | 2 +- scripts/config.yml | 22 +++++++++++----------- scripts/getFetch.py | 2 -- scripts/sync.sh | 6 +++--- 4 files changed, 15 insertions(+), 17 deletions(-) diff --git a/pub/form.html b/pub/form.html index d22785b..edde506 100644 --- a/pub/form.html +++ b/pub/form.html @@ -58,7 +58,7 @@ formData.append('title', title); formData.append('content', content); - fetch(PUSHNOTIFICAATIONURL, { + fetch(PUSHAPIADDRESS, { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded', diff --git a/scripts/config.yml b/scripts/config.yml index 82fa3e3..f4637aa 100644 --- a/scripts/config.yml +++ b/scripts/config.yml @@ -28,28 +28,28 @@ global: repos: ARCHLINUX: url: rsync://mirrors.xtom.de/archlinux/ - duration: 4 + delay: 4 name: "ArchLinux (x86_64)" path: archlinux log: ./logs/archlinux last_sync: "2023-10-09T23:48Z" UBUNTU: url: rsync://rsync.archive.ubuntu.com/ubuntu/ - duration: 4 + delay: 4 name: "Ubuntu" path: ubuntu log: ./logs/ubuntu last_sync: "2023-10-09T23:48Z" UBUNTU_CD: url: rsync://releases.ubuntu.com/releases/ - duration: 24 + delay: 24 name: "Ubuntu Releases" path: ubuntu_cd log: ./logs/ubuntu_cd last_sync: "2023-10-09T23:48Z" UBUNTU_CD_OLD: url: rsync://old-releases.ubuntu.com/releases/ - duration: 24 + delay: 24 name: "Ubuntu Releases (Old)" path: ubuntu_cd_old log: ./logs/ubuntu_cd_old @@ -57,7 +57,7 @@ repos: DEBIAN: url: rsync://mirrors.xtom.jp/debian/ type: ftpsync - duration: 4 + delay: 4 name: Debian path: debian scripts: @@ -65,28 +65,28 @@ repos: last_sync: "2023-10-09T23:48Z" DEBIAN_CD: url: rsync://ftp.lanet.kr/debian-cd/ - duration: 24 + delay: 24 name: "Debian CD" path: debian_cd log: ./logs/debian_cd last_sync: "2023-10-09T23:48Z" FEDORA: url: rsync://dl.fedoraproject.org/fedora-enchilada/linux/ - duration: 4 + delay: 4 name: "Fedora" path: fedora log: ./logs/fedora last_sync: "2023-10-09T23:30Z" RASPBIAN: url: rsync://archive.raspbian.org/archive/ - duration: 6 + delay: 6 name: "Raspbian" path: raspbian log: ./logs/raspbian last_sync: "2023-10-09T23:30Z" MANJARO: url: rsync://ftp.riken.jp/manjaro/ - duration: 4 + delay: 4 name: Manjaro path: manjaro log: ./logs/manjaro @@ -96,14 +96,14 @@ repos: path: archlinuxarm url: http://jp.mirror.archlinuxarm.org/ type: http - duration: 12 + delay: 12 last_sync: "2023-10-09T23:30Z" ASAHILINUX: name: "AsahiLinux" path: asahilinux url: https://cdn.asahilinux.org/ type: http - duration: 12 + delay: 12 last_sync: "2023-10-09T23:30Z" index: - ARCHLINUX diff --git a/scripts/getFetch.py b/scripts/getFetch.py index 1b881c0..4360d84 100644 --- a/scripts/getFetch.py +++ b/scripts/getFetch.py @@ -53,8 +53,6 @@ if __name__ == "__main__": print("Usage: createFetch.py [URL] [Path] (fetch)") sys.exit() - # urls = {"archlinuxarm": "http://jp.mirror.archlinuxarm.org/", "asahilinux": "https://cdn.asahilinux.org/", "linux-surface": "https://pkg.surfacelinux.com/arch/"} - if "http" in sys.argv[1]: if input(f"[*] Download from {sys.argv[1]}? ") in "Yy": url = sys.argv[1] diff --git a/scripts/sync.sh b/scripts/sync.sh index 9599a23..29bae8f 100755 --- a/scripts/sync.sh +++ b/scripts/sync.sh @@ -110,10 +110,10 @@ if [[ "${repos[0]}" == "ALL" ]]; then fi for repo in "${repos[@]}"; do echo Checking $repo... - duration=$(parse_yaml "repos.${repo}.duration") + delay=$(parse_yaml "repos.${repo}.delay") last_sync_timestamp=$(date -d "$(parse_yaml "repos.${repo}.last_sync")" +%s) - next_sync_timestamp=$(( last_sync_timestamp + duration * 3600 )) - next_sync_timestamp=1 + next_sync_timestamp=$(( last_sync_timestamp + delay * 3600 )) + if [ $next_sync_timestamp -le $(date +%s) ]; then echo "Lastsync $last_sync_timestamp" echo "Syncing $repo..."