mirror of
https://gh.llkk.cc/https://github.com/WeblateOrg/scripts.git
synced 2025-10-03 15:01:00 +08:00
Bring back non-dockerized support
This commit is contained in:
parent
b7bc7ba901
commit
001d67dc9a
1 changed files with 7 additions and 2 deletions
|
@ -16,9 +16,14 @@ if [ -n "$KEY" ] ; then
|
|||
fi
|
||||
|
||||
if [ -z "$KEY" ] ; then
|
||||
cd /home/weblate/weblate || exit 1
|
||||
|
||||
echo "Generating new key"
|
||||
KEY="$(sudo -u weblate docker compose exec --user weblate weblate weblate shell -c 'from weblate.auth.models import User; user = User.objects.create(username="monitor"); print(user.auth_token.key)')"
|
||||
if [ -f "/home/weblate/weblate/docker-compose.override.yml" ] ; then
|
||||
cd /home/weblate/weblate || exit 1
|
||||
KEY="$(sudo -u weblate docker compose exec --user weblate weblate weblate shell -c 'from weblate.auth.models import User; user = User.objects.create(username="monitor"); print(user.auth_token.key)')"
|
||||
else
|
||||
KEY="$(sudo -u weblate /home/weblate/weblate-env/bin/weblate shell -c 'from weblate.auth.models import User; user = User.objects.create(username="monitor"); print(user.auth_token.key)')"
|
||||
fi
|
||||
|
||||
sed -i "s/^env.KEY .*/env.KEY $KEY/" /etc/munin/plugin-conf.d/weblate_servers
|
||||
fi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue