removed test things
This commit is contained in:
		
							parent
							
								
									d2eeadba89
								
							
						
					
					
						commit
						dfa21385f3
					
				| 
						 | 
					@ -58,7 +58,7 @@
 | 
				
			||||||
      formData.append('title', title);
 | 
					      formData.append('title', title);
 | 
				
			||||||
      formData.append('content', content);
 | 
					      formData.append('content', content);
 | 
				
			||||||
      
 | 
					      
 | 
				
			||||||
      fetch(PUSHNOTIFICAATIONURL, {
 | 
					      fetch(PUSHAPIADDRESS, {
 | 
				
			||||||
        method: 'POST',
 | 
					        method: 'POST',
 | 
				
			||||||
        headers: {
 | 
					        headers: {
 | 
				
			||||||
          'Content-Type': 'application/x-www-form-urlencoded',
 | 
					          'Content-Type': 'application/x-www-form-urlencoded',
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -28,28 +28,28 @@ global:
 | 
				
			||||||
repos:
 | 
					repos:
 | 
				
			||||||
  ARCHLINUX:
 | 
					  ARCHLINUX:
 | 
				
			||||||
    url: rsync://mirrors.xtom.de/archlinux/
 | 
					    url: rsync://mirrors.xtom.de/archlinux/
 | 
				
			||||||
    duration: 4
 | 
					    delay: 4
 | 
				
			||||||
    name: "ArchLinux (x86_64)"
 | 
					    name: "ArchLinux (x86_64)"
 | 
				
			||||||
    path: archlinux
 | 
					    path: archlinux
 | 
				
			||||||
    log: ./logs/archlinux
 | 
					    log: ./logs/archlinux
 | 
				
			||||||
    last_sync: "2023-10-09T23:48Z"
 | 
					    last_sync: "2023-10-09T23:48Z"
 | 
				
			||||||
  UBUNTU:
 | 
					  UBUNTU:
 | 
				
			||||||
    url: rsync://rsync.archive.ubuntu.com/ubuntu/
 | 
					    url: rsync://rsync.archive.ubuntu.com/ubuntu/
 | 
				
			||||||
    duration: 4
 | 
					    delay: 4
 | 
				
			||||||
    name: "Ubuntu"
 | 
					    name: "Ubuntu"
 | 
				
			||||||
    path: ubuntu
 | 
					    path: ubuntu
 | 
				
			||||||
    log: ./logs/ubuntu
 | 
					    log: ./logs/ubuntu
 | 
				
			||||||
    last_sync: "2023-10-09T23:48Z"
 | 
					    last_sync: "2023-10-09T23:48Z"
 | 
				
			||||||
  UBUNTU_CD:
 | 
					  UBUNTU_CD:
 | 
				
			||||||
    url: rsync://releases.ubuntu.com/releases/
 | 
					    url: rsync://releases.ubuntu.com/releases/
 | 
				
			||||||
    duration: 24
 | 
					    delay: 24
 | 
				
			||||||
    name: "Ubuntu Releases"
 | 
					    name: "Ubuntu Releases"
 | 
				
			||||||
    path: ubuntu_cd
 | 
					    path: ubuntu_cd
 | 
				
			||||||
    log: ./logs/ubuntu_cd
 | 
					    log: ./logs/ubuntu_cd
 | 
				
			||||||
    last_sync: "2023-10-09T23:48Z"
 | 
					    last_sync: "2023-10-09T23:48Z"
 | 
				
			||||||
  UBUNTU_CD_OLD:
 | 
					  UBUNTU_CD_OLD:
 | 
				
			||||||
    url: rsync://old-releases.ubuntu.com/releases/
 | 
					    url: rsync://old-releases.ubuntu.com/releases/
 | 
				
			||||||
    duration: 24
 | 
					    delay: 24
 | 
				
			||||||
    name: "Ubuntu Releases (Old)"
 | 
					    name: "Ubuntu Releases (Old)"
 | 
				
			||||||
    path: ubuntu_cd_old
 | 
					    path: ubuntu_cd_old
 | 
				
			||||||
    log: ./logs/ubuntu_cd_old
 | 
					    log: ./logs/ubuntu_cd_old
 | 
				
			||||||
| 
						 | 
					@ -57,7 +57,7 @@ repos:
 | 
				
			||||||
  DEBIAN:
 | 
					  DEBIAN:
 | 
				
			||||||
    url: rsync://mirrors.xtom.jp/debian/
 | 
					    url: rsync://mirrors.xtom.jp/debian/
 | 
				
			||||||
    type: ftpsync
 | 
					    type: ftpsync
 | 
				
			||||||
    duration: 4
 | 
					    delay: 4
 | 
				
			||||||
    name: Debian
 | 
					    name: Debian
 | 
				
			||||||
    path: debian
 | 
					    path: debian
 | 
				
			||||||
    scripts:
 | 
					    scripts:
 | 
				
			||||||
| 
						 | 
					@ -65,28 +65,28 @@ repos:
 | 
				
			||||||
    last_sync: "2023-10-09T23:48Z"
 | 
					    last_sync: "2023-10-09T23:48Z"
 | 
				
			||||||
  DEBIAN_CD:
 | 
					  DEBIAN_CD:
 | 
				
			||||||
    url: rsync://ftp.lanet.kr/debian-cd/
 | 
					    url: rsync://ftp.lanet.kr/debian-cd/
 | 
				
			||||||
    duration: 24
 | 
					    delay: 24
 | 
				
			||||||
    name: "Debian CD"
 | 
					    name: "Debian CD"
 | 
				
			||||||
    path: debian_cd
 | 
					    path: debian_cd
 | 
				
			||||||
    log: ./logs/debian_cd
 | 
					    log: ./logs/debian_cd
 | 
				
			||||||
    last_sync: "2023-10-09T23:48Z"
 | 
					    last_sync: "2023-10-09T23:48Z"
 | 
				
			||||||
  FEDORA:
 | 
					  FEDORA:
 | 
				
			||||||
    url: rsync://dl.fedoraproject.org/fedora-enchilada/linux/
 | 
					    url: rsync://dl.fedoraproject.org/fedora-enchilada/linux/
 | 
				
			||||||
    duration: 4
 | 
					    delay: 4
 | 
				
			||||||
    name: "Fedora"
 | 
					    name: "Fedora"
 | 
				
			||||||
    path: fedora
 | 
					    path: fedora
 | 
				
			||||||
    log: ./logs/fedora
 | 
					    log: ./logs/fedora
 | 
				
			||||||
    last_sync: "2023-10-09T23:30Z"
 | 
					    last_sync: "2023-10-09T23:30Z"
 | 
				
			||||||
  RASPBIAN:
 | 
					  RASPBIAN:
 | 
				
			||||||
    url: rsync://archive.raspbian.org/archive/
 | 
					    url: rsync://archive.raspbian.org/archive/
 | 
				
			||||||
    duration: 6
 | 
					    delay: 6
 | 
				
			||||||
    name: "Raspbian"
 | 
					    name: "Raspbian"
 | 
				
			||||||
    path: raspbian
 | 
					    path: raspbian
 | 
				
			||||||
    log: ./logs/raspbian
 | 
					    log: ./logs/raspbian
 | 
				
			||||||
    last_sync: "2023-10-09T23:30Z"
 | 
					    last_sync: "2023-10-09T23:30Z"
 | 
				
			||||||
  MANJARO:
 | 
					  MANJARO:
 | 
				
			||||||
    url: rsync://ftp.riken.jp/manjaro/
 | 
					    url: rsync://ftp.riken.jp/manjaro/
 | 
				
			||||||
    duration: 4
 | 
					    delay: 4
 | 
				
			||||||
    name: Manjaro
 | 
					    name: Manjaro
 | 
				
			||||||
    path: manjaro
 | 
					    path: manjaro
 | 
				
			||||||
    log: ./logs/manjaro
 | 
					    log: ./logs/manjaro
 | 
				
			||||||
| 
						 | 
					@ -96,14 +96,14 @@ repos:
 | 
				
			||||||
    path: archlinuxarm
 | 
					    path: archlinuxarm
 | 
				
			||||||
    url: http://jp.mirror.archlinuxarm.org/
 | 
					    url: http://jp.mirror.archlinuxarm.org/
 | 
				
			||||||
    type: http
 | 
					    type: http
 | 
				
			||||||
    duration: 12
 | 
					    delay: 12
 | 
				
			||||||
    last_sync: "2023-10-09T23:30Z"
 | 
					    last_sync: "2023-10-09T23:30Z"
 | 
				
			||||||
  ASAHILINUX:
 | 
					  ASAHILINUX:
 | 
				
			||||||
    name: "AsahiLinux"
 | 
					    name: "AsahiLinux"
 | 
				
			||||||
    path: asahilinux
 | 
					    path: asahilinux
 | 
				
			||||||
    url: https://cdn.asahilinux.org/
 | 
					    url: https://cdn.asahilinux.org/
 | 
				
			||||||
    type: http
 | 
					    type: http
 | 
				
			||||||
    duration: 12
 | 
					    delay: 12
 | 
				
			||||||
    last_sync: "2023-10-09T23:30Z"
 | 
					    last_sync: "2023-10-09T23:30Z"
 | 
				
			||||||
index:
 | 
					index:
 | 
				
			||||||
  - ARCHLINUX
 | 
					  - ARCHLINUX
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -53,8 +53,6 @@ if __name__ == "__main__":
 | 
				
			||||||
	    print("Usage: createFetch.py [URL] [Path] (fetch)")
 | 
						    print("Usage: createFetch.py [URL] [Path] (fetch)")
 | 
				
			||||||
	    sys.exit()
 | 
						    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 "http" in sys.argv[1]:
 | 
				
			||||||
	    if input(f"[*] Download from {sys.argv[1]}? ") in "Yy":
 | 
						    if input(f"[*] Download from {sys.argv[1]}? ") in "Yy":
 | 
				
			||||||
	        url = sys.argv[1]
 | 
						        url = sys.argv[1]
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -110,10 +110,10 @@ if [[ "${repos[0]}" == "ALL" ]]; then
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
for repo in "${repos[@]}"; do
 | 
					for repo in "${repos[@]}"; do
 | 
				
			||||||
    echo Checking $repo...
 | 
					    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)
 | 
					    last_sync_timestamp=$(date -d "$(parse_yaml "repos.${repo}.last_sync")" +%s)
 | 
				
			||||||
    next_sync_timestamp=$(( last_sync_timestamp + duration * 3600 ))
 | 
					    next_sync_timestamp=$(( last_sync_timestamp + delay * 3600 ))
 | 
				
			||||||
    next_sync_timestamp=1
 | 
					    
 | 
				
			||||||
    if [ $next_sync_timestamp -le $(date +%s) ]; then
 | 
					    if [ $next_sync_timestamp -le $(date +%s) ]; then
 | 
				
			||||||
        echo "Lastsync $last_sync_timestamp"
 | 
					        echo "Lastsync $last_sync_timestamp"
 | 
				
			||||||
        echo "Syncing $repo..."
 | 
					        echo "Syncing $repo..."
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue