Skip to content

Commit 3cbf24b

Browse files
committed
Implement migration for suspended users.
1 parent 336e2c0 commit 3cbf24b

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

install/upgrade/manual/migrate_multiphp.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,18 @@ if [ "$num_php_versions" -gt 1 ] && [ -z "$WEB_BACKEND" ]; then
4848

4949
# Migrate domains
5050
for user in $($BIN/v-list-sys-users plain); do
51+
# Check if user is suspended
52+
if [ "$SUSPENDED" = "yes" ]; then
53+
suspended="yes"
54+
$BIN/v-unsuspend-user $user
55+
fi
5156
echo "Migrating legacy multiphp domains for user: $user"
5257
for domain in $($BIN/v-list-web-domains $user plain |cut -f1); do
58+
# Check if web domain is suspended
59+
if [ "$SUSPENDED" = "yes" ]; then
60+
domain_suspended="yes"
61+
$BIN/v-unsuspend-web-domain $domain
62+
fi
5363
echo "Processing domain: $domain"
5464
web_tpl="default"
5565
backend_tpl="$DEFAULT_BTPL"
@@ -106,7 +116,19 @@ if [ "$num_php_versions" -gt 1 ] && [ -z "$WEB_BACKEND" ]; then
106116
$BIN/v-change-web-domain-tpl "$user" "$domain" "$web_tpl" "no"
107117
$BIN/v-change-web-domain-backend-tpl "$user" "$domain" "$backend_tpl" "no"
108118
echo -e "--done--\n"
119+
120+
# Suspend domain again, if it was suspended
121+
if [ "$domain_suspended" = "yes" ]; then
122+
unset domain_suspended
123+
$BIN/v-suspend-web-domain $domain
124+
fi
109125
done
126+
127+
# Suspend user again, if he was suspended
128+
if [ "$suspended" = "yes" ]; then
129+
unset suspended
130+
$BIN/v-suspend-user $user
131+
fi
110132
done
111133

112134
# cleanup legacy multiphp templates

0 commit comments

Comments
 (0)