more work on configure
This commit is contained in:
+26
-7
@@ -541,15 +541,24 @@ failed() {
|
||||
[ -n "$3" ] && FIXES+=("$3") FIX_TITLES+=("$1")
|
||||
}
|
||||
|
||||
# Test an Online Accounts account: <title> <provider> <identity> <setup> <fix>
|
||||
# Test an Online Accounts account, and that none of what CoreDesktop set it up
|
||||
# for is turned off in Settings:
|
||||
# <title> <provider> <identity> <setup> <fix> <enable>
|
||||
test_account() {
|
||||
local error
|
||||
local error off works=1
|
||||
if ! "$GOA_ACCOUNT" exists "$2" "$3" 2> /dev/null; then
|
||||
failed "$1" "not set up" "$4"
|
||||
elif error="$("$GOA_ACCOUNT" check "$2" "$3" 2>&1)"; then
|
||||
passed "$1"
|
||||
else
|
||||
return
|
||||
fi
|
||||
if ! error="$("$GOA_ACCOUNT" check "$2" "$3" 2>&1)"; then
|
||||
failed "$1" "can't sign in" "$5" "$error"
|
||||
works=0
|
||||
fi
|
||||
off="$("$GOA_ACCOUNT" disabled "$2" "$3" 2> /dev/null)"
|
||||
if [ -n "$off" ]; then
|
||||
failed "$1" "turned off in Settings: $off" "$6"
|
||||
elif [ $works -eq 1 ]; then
|
||||
passed "$1"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -615,8 +624,8 @@ test_core() {
|
||||
failed "Superpanel" "can't reach https://superpanel.$CORE_DOMAIN"
|
||||
fi
|
||||
test_account "Nextcloud in Online Accounts" owncloud "$CORE_USER@nextcloud.$CORE_DOMAIN" \
|
||||
setup_nextcloud fix_nextcloud
|
||||
test_account "Email in Online Accounts" imap_smtp "$CORE_EMAIL" setup_email fix_email
|
||||
setup_nextcloud fix_nextcloud enable_nextcloud
|
||||
test_account "Email in Online Accounts" imap_smtp "$CORE_EMAIL" setup_email fix_email enable_email
|
||||
test_files
|
||||
[ "$CORE_DOMAIN" = "$MAIN_DOMAIN" ] && element_installed && test_element
|
||||
backup_on "$CORE_DOMAIN" && test_backups
|
||||
@@ -631,6 +640,16 @@ fix_nextcloud() {
|
||||
echo "Nextcloud in Online Accounts has a new app password."
|
||||
}
|
||||
|
||||
enable_nextcloud() {
|
||||
"$GOA_ACCOUNT" enable owncloud "$CORE_USER@nextcloud.$CORE_DOMAIN" || return 1
|
||||
echo "Turned Nextcloud's calendar, contacts and files back on."
|
||||
}
|
||||
|
||||
enable_email() {
|
||||
"$GOA_ACCOUNT" enable imap_smtp "$CORE_EMAIL" || return 1
|
||||
echo "Turned email back on."
|
||||
}
|
||||
|
||||
# Email gets your Core password. If the mail server still says no, its
|
||||
# settings may have changed, so add it again with the server's settings now.
|
||||
fix_email() {
|
||||
|
||||
Reference in New Issue
Block a user