Fix Nextcloud admin unlocking

This commit is contained in:
David Duque 2022-04-27 23:23:53 +01:00
parent e5ffae7791
commit 04f4910b51
2 changed files with 4 additions and 7 deletions

View file

@ -1,3 +0,0 @@
#!/bin/bash
# This script has moved.
management/cli.py "$@"

View file

@ -8,16 +8,16 @@
source /etc/mailinabox.conf # load global vars
ADMIN=$(./mail.py user admins | head -n 1)
test -z "$1" || ADMIN=$1
ADMIN=$(management/cli.py user admins | head -n 1)
test -z "$1" || ADMIN=$1
echo I am going to unlock admin features for $ADMIN.
echo You can provide another user to unlock as the first argument of this script.
echo
echo WARNING: you could break mail-in-a-box when fiddling around with Nextcloud\'s admin interface
echo If in doubt, press CTRL-C to cancel.
echo
echo
echo Press enter to continue.
read
sudo -u www-data php /usr/local/lib/owncloud/occ group:adduser admin $ADMIN && echo Done.
sudo -u www-data php /usr/local/lib/owncloud/occ group:adduser admin "$ADMIN" && echo Done.