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
689 B

  1. #!/bin/sh
  2. asu_password=$(dd if=/dev/urandom bs=16 count=1 2>/dev/null | sha256sum | cut -d' ' -f1)
  3. asu_tables="$(ls -1 /usr/lib/python*/site-packages/asu/utils/tables.sql | head -n 1)"
  4. uci -q batch <<EOF
  5. del postgresql.asu
  6. set postgresql.asu=postgres-db
  7. set postgresql.asu.name=asu
  8. set postgresql.asu.user=asu
  9. set postgresql.asu.pass='$asu_password'
  10. set postgresql.asu.script='$asu_tables'
  11. commit postgresql
  12. EOF
  13. sed -i "s/database_user.*/database_user: asu/" /etc/asu/config.yml
  14. sed -i "s/database_pass.*/database_pass: $asu_password/" /etc/asu/config.yml
  15. cp -r /usr/lib/python*/site-packages/asu/utils/distributions /etc/asu/
  16. chown -R root:asu /etc/asu
  17. chmod -R g+rX /etc/asu