gogs.postinst 441 B

123456789101112131415
  1. adduser --quiet \
  2. --system \
  3. --disabled-password \
  4. --home /var/git \
  5. --no-create-home \
  6. --shell /bin/false \
  7. git
  8. case "$1" in
  9. configure)
  10. mysql -e "CREATE USER IF NOT EXISTS 'git'@'localhost' IDENTIFIED VIA unix_socket;"
  11. mysql -e "CREATE DATABASE IF NOT EXISTS gogs CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;"
  12. ;;
  13. ...
  14. esac