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.

test-env-check.sh 579B

123456789101112131415161718192021222324
  1. #!/bin/sh
  2. set -e
  3. if [ ! -f ./build/test-env-check.sh ]; then
  4. echo "${0} can only be executed in gitea source root directory"
  5. exit 1
  6. fi
  7. echo "check uid ..."
  8. # the uid of gitea defined in "https://gitea.com/gitea/test-env" is 1000
  9. gitea_uid=$(id -u gitea)
  10. if [ "$gitea_uid" != "1000" ]; then
  11. echo "The uid of linux user 'gitea' is expected to be 1000, but it is $gitea_uid"
  12. exit 1
  13. fi
  14. cur_uid=$(id -u)
  15. if [ "$cur_uid" != "0" -a "$cur_uid" != "$gitea_uid" ]; then
  16. echo "The uid of current linux user is expected to be 0 or $gitea_uid, but it is $cur_uid"
  17. exit 1
  18. fi