INNER CODE UNIT · Shell
WEBMIN_PORT
magenx/Magento-2-server-installation · magenx.install.latest.sh:2206
WEBMIN_PORT=$(shuf -i 17556-17728 -n 1)
sed -i 's/theme=gray-theme/theme=authentic-theme/' /etc/webmin/config
sed -i 's/preroot=gray-theme/preroot=authentic-theme/' /etc/webmin/miniserv.conf
sed -i "s/port=10000/port=${WEBMIN_PORT}/" /etc/webmin/miniserv.conf
sed -i "s/listen=10000/listen=${WEBMIN_PORT}/" /etc/webmin/miniserv.conf
sed -i '/keyfile=\|certfile=/d' /etc/webmin/miniserv.conf
echo "keyfile=/etc/letsencrypt/live/${DOMAIN}/privkey.pem" >> /etc/webmin/miniserv.conf
echo "certfile=/etc/letsencrypt/live/${DOMAIN}/cert.pem" >> /etc/webmin/miniserv.conf
echo "webmin_${BRAND}:\$1\$84720675\$F08uAAcIMcN8lZNg9D74p1:::::$(date +%s):::0::::" > /etc/webmin/miniserv.users
sed -i "s/root:/webmin_${BRAND}:/" /etc/webmin/webmin.acl
WEBMIN_PASSWORD=$(head -c 500 /dev/urandom | tr -dc 'a-zA-Z0-9@#%^?=+_[]{}()' | fold -w 15 | head -n 1)
/usr/share/webmin/changepass.pl /etc/webmin/ webmin_${BRAND} "${WEBMIN_PASSWORD}"
systemctl enable webmin
/etc/webmin/restart
_space 1