2
0

repo-ck.sh 549 B

1234567891011121314151617
  1. #!/bin/bash
  2. function sync_repo_ck() {
  3. repo_url="$1"
  4. repo_dir="$2"
  5. [ ! -d "$repo_dir" ] && mkdir -p "$repo_dir"
  6. cd $repo_dir
  7. lftp "${repo_url}/" -e 'mirror -v -P 5 --delete --only-missing --only-newer --no-recursion; bye' || return 1
  8. wget "${repo_url}/repo-ck.db" -O "repo-ck.db" || return 1
  9. wget "${repo_url}/repo-ck.files" -O "repo-ck.files"
  10. }
  11. stat=0
  12. sync_repo_ck "${TUNASYNC_UPSTREAM_URL}/x86_64" "${TUNASYNC_WORKING_DIR}/x86_64" || stat=1
  13. sync_repo_ck "${TUNASYNC_UPSTREAM_URL}/i686" "${TUNASYNC_WORKING_DIR}/i686" || stat=1
  14. exit $stat