A script to update Gitea
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

22 lines
570 B

  1. #!/bin/sh
  2. include(macros.m4)dnl
  3. if [[ ! $(id -u) = $(0 + 0) ]]; then
  4. echo "Error: must be run as root (UID 0)" > /dev/stderr
  5. fi
  6. if [[ "$1" = "cleanup" ]]; then
  7. do_as_user user rm gitea_binary_dir/gitea-old
  8. exit 0
  9. fi
  10. if [[ "$1" = "get" ]]; then
  11. gitea_version="$2"
  12. wget -O gitea_binary_dir/gitea-new "https://dl.gitea.io/gitea/$gitea_version/gitea-${gitea_version}-os-arch"
  13. exit 0
  14. fi
  15. stop_gitea
  16. do_as_user user cp gitea_binary_dir/gitea gitea_binary_dir/gitea-old
  17. do_as_user user mv gitea_binary_dir/gitea-new gitea_binary_dir/gitea
  18. start_gitea