Skip to content

Instantly share code, notes, and snippets.

@ijortengab
Created May 19, 2024 08:26
Show Gist options
  • Save ijortengab/a2b3fb2cbe7561ebd880a036922717e3 to your computer and use it in GitHub Desktop.
Save ijortengab/a2b3fb2cbe7561ebd880a036922717e3 to your computer and use it in GitHub Desktop.
red() { echo -ne "\e[91m" >&2; echo -n "$@" >&2; echo -ne "\e[39m" >&2; }
green() { echo -ne "\e[92m" >&2; echo -n "$@" >&2; echo -ne "\e[39m" >&2; }
yellow() { echo -ne "\e[93m" >&2; echo -n "$@" >&2; echo -ne "\e[39m" >&2; }
blue() { echo -ne "\e[94m" >&2; echo -n "$@" >&2; echo -ne "\e[39m" >&2; }
magenta() { echo -ne "\e[95m" >&2; echo -n "$@" >&2; echo -ne "\e[39m" >&2; }
error() { echo -n "$INDENT" >&2; red '#' "$@" >&2; echo >&2; }
success() { echo -n "$INDENT" >&2; green '#' "$@" >&2; echo >&2; }
chapter() { echo -n "$INDENT" >&2; yellow '#' "$@" >&2; echo >&2; }
title() { echo -n "$INDENT" >&2; blue '#' "$@" >&2; echo >&2; }
code() { echo -n "$INDENT" >&2; magenta "$@" >&2; echo >&2; }
x() { echo >&2; exit 1; }
e() { echo -n "$INDENT" >&2; echo "#" "$@" >&2; }
_() { echo -n "$INDENT" >&2; echo -n "#" "$@" >&2; }
_,() { echo -n "$@" >&2; }
_.() { echo >&2; }
__() { echo -n "$INDENT" >&2; echo -n "#" ' ' >&2; [ -n "$1" ] && echo "$@" >&2 || echo -n >&2; }
____() { echo >&2; [ -n "$delay" ] && sleep "$delay"; }
SUBDOMAIN_ISPCONFIG=${SUBDOMAIN_ISPCONFIG:=cp}
code 'SUBDOMAIN_ISPCONFIG="'$SUBDOMAIN_ISPCONFIG'"'
SUBDOMAIN_PHPMYADMIN=${SUBDOMAIN_PHPMYADMIN:=db}
code 'SUBDOMAIN_PHPMYADMIN="'$SUBDOMAIN_PHPMYADMIN'"'
SUBDOMAIN_ROUNDCUBE=${SUBDOMAIN_ROUNDCUBE:=mail}
code 'SUBDOMAIN_ROUNDCUBE="'$SUBDOMAIN_ROUNDCUBE'"'
MAILBOX_ADMIN=${MAILBOX_ADMIN:=admin}
code 'MAILBOX_ADMIN="'$MAILBOX_ADMIN'"'
MAILBOX_SUPPORT=${MAILBOX_SUPPORT:=support}
code 'MAILBOX_SUPPORT="'$MAILBOX_SUPPORT'"'
MAILBOX_WEB=${MAILBOX_WEB:=webmaster}
code 'MAILBOX_WEB="'$MAILBOX_WEB'"'
MAILBOX_HOST=${MAILBOX_HOST:=hostmaster}
code 'MAILBOX_HOST="'$MAILBOX_HOST'"'
MAILBOX_POST=${MAILBOX_POST:=postmaster}
isfast=' --fast'
code 'MAILBOX_POST="'$MAILBOX_POST'"'
domain=ui.web.id
php_version=8.3
INDENT+=" " \
rcm-ispconfig-setup-wrapper-nginx-setup-php.sh $isfast --root-sure \
--project=ispconfig \
--subdomain="$SUBDOMAIN_ISPCONFIG" \
--domain="$domain" \
--php-version="$php_version" \
&& INDENT+=" " \
rcm-ispconfig-setup-wrapper-nginx-setup-php.sh $isfast --root-sure \
--project=roundcube \
--subdomain="$SUBDOMAIN_ROUNDCUBE" \
--domain="$domain" \
--php-version="$php_version" \
&& INDENT+=" " \
rcm-ispconfig-setup-wrapper-nginx-setup-php.sh $isfast --root-sure \
--project=phpmyadmin \
--subdomain="$SUBDOMAIN_PHPMYADMIN" \
--domain="$domain" \
--php-version="$php_version" \
&& INDENT+=" " \
rcm-ispconfig-setup-wrapper-nginx-setup-php.sh $isfast --root-sure \
--project=ispconfig \
--subdomain="${SUBDOMAIN_ISPCONFIG}.${domain}" \
--domain="localhost" \
--php-version="$php_version" \
&& INDENT+=" " \
rcm-ispconfig-setup-wrapper-nginx-setup-php.sh $isfast --root-sure \
--project=roundcube \
--subdomain="${SUBDOMAIN_ROUNDCUBE}.${domain}" \
--domain="localhost" \
--php-version="$php_version" \
&& INDENT+=" " \
rcm-ispconfig-setup-wrapper-nginx-setup-php.sh $isfast --root-sure \
--project=phpmyadmin \
--subdomain="${SUBDOMAIN_PHPMYADMIN}.${domain}" \
--domain="localhost" \
--php-version="$php_version" \
&& INDENT+=" " \
rcm-ispconfig-setup-wrapper-certbot-setup-nginx.sh $isfast --root-sure \
--standalone \
--domain="$domain" \
--subdomain="$SUBDOMAIN_ISPCONFIG" \
&& INDENT+=" " \
rcm-ispconfig-setup-wrapper-certbot-setup-nginx.sh $isfast --root-sure \
--standalone \
--domain="$domain" \
--subdomain="$SUBDOMAIN_PHPMYADMIN" \
&& INDENT+=" " \
rcm-ispconfig-setup-wrapper-certbot-setup-nginx.sh $isfast --root-sure \
--standalone \
--domain="$domain" \
--subdomain="$SUBDOMAIN_ROUNDCUBE" \
; [ ! $? -eq 0 ] && x
INDENT+=" " \
rcm-ispconfig-control-manage-domain.sh $isfast --root-sure \
add \
--domain="$domain" \
&& INDENT+=" " \
rcm-ispconfig-control-manage-email-mailbox.sh $isfast --root-sure --ispconfig-domain-exists-sure \
--name="$MAILBOX_ADMIN" \
--domain="$domain" \
&& INDENT+=" " \
rcm-ispconfig-control-manage-email-mailbox.sh $isfast --root-sure --ispconfig-domain-exists-sure \
--name="$MAILBOX_SUPPORT" \
--domain="$domain" \
&& INDENT+=" " \
rcm-ispconfig-control-manage-email-alias.sh $isfast --root-sure --ispconfig-domain-exists-sure \
--name="$MAILBOX_HOST" \
--domain="$domain" \
--destination-name="$MAILBOX_ADMIN" \
--destination-domain="$domain" \
&& INDENT+=" " \
rcm-ispconfig-control-manage-email-alias.sh $isfast --root-sure --ispconfig-domain-exists-sure \
--name="$MAILBOX_POST" \
--domain="$domain" \
--destination-name="$MAILBOX_ADMIN" \
--destination-domain="$domain" \
&& INDENT+=" " \
rcm-ispconfig-control-manage-email-alias.sh $isfast --root-sure --ispconfig-domain-exists-sure \
--name="$MAILBOX_WEB" \
--domain="$domain" \
--destination-name="$MAILBOX_ADMIN" \
--destination-domain="$domain" \
; [ ! $? -eq 0 ] && x
INDENT+=" " \
rcm-ispconfig-setup-dump-variables.sh $isfast --root-sure \
--domain="$domain" \
--hostname="$hostname" \
--ip-address="$ip_address" \
; [ ! $? -eq 0 ] && x
chapter Send Welcome email.
code postqueue -f
postqueue -f
____
chapter Finish
e If you want to see the credentials again, please execute this command:
code rcm-ispconfig-setup-dump-variables.sh --domain=$domain
____
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment