Compare commits

...

2 Commits

Author SHA1 Message Date
Matthew Saunders Brown
cf7a968e8c reorder phpPriority code and php restart 2024-12-08 14:24:18 -08:00
Matthew Saunders Brown
e49bea839e regex matching not working, use individual entries 2024-12-08 14:22:07 -08:00
2 changed files with 6 additions and 4 deletions

View File

@ -1,6 +1,8 @@
vpanel ALL=(Debian-exim:ssl-cert) NOPASSWD: /usr/local/bin/vmail-dkim-*.sh vpanel ALL=(Debian-exim:ssl-cert) NOPASSWD: /usr/local/bin/vmail-dkim-*.sh
vpanel ALL=(Debian-exim) NOPASSWD: /usr/local/bin/vmail-purge-spool.sh vpanel ALL=(Debian-exim) NOPASSWD: /usr/local/bin/vmail-purge-spool.sh
vpanel ALL=(root) NOPASSWD: /usr/local/bin/vmail-(domains|dovecot|webmail)-*.sh vpanel ALL=(root) NOPASSWD: /usr/local/bin/vmail-domains-*.sh
vpanel ALL=(root) NOPASSWD: /usr/local/bin/vmail-dovecot-*.sh
vpanel ALL=(root) NOPASSWD: /usr/local/bin/vmail-webmail-*.sh
vpanel ALL=(vmail) NOPASSWD: /usr/local/bin/vmail*.sh vpanel ALL=(vmail) NOPASSWD: /usr/local/bin/vmail*.sh
vpanel ALL=(root) NOPASSWD: /usr/local/bin/letsencrypt-*.sh vpanel ALL=(root) NOPASSWD: /usr/local/bin/letsencrypt-*.sh
vpanel ALL=(root) NOPASSWD: /usr/local/bin/vhost*.sh vpanel ALL=(root) NOPASSWD: /usr/local/bin/vhost*.sh

View File

@ -11,17 +11,17 @@ chmod 644 /usr/local/lib/systemd/system/vpanel-php-fpm-socket-helper.service
PHP_MAJOR_VERSION=`php -r "echo PHP_MAJOR_VERSION;"` PHP_MAJOR_VERSION=`php -r "echo PHP_MAJOR_VERSION;"`
PHP_MINOR_VERSION=`php -r "echo PHP_MINOR_VERSION;"` PHP_MINOR_VERSION=`php -r "echo PHP_MINOR_VERSION;"`
phpVersion=$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION phpVersion=$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION
phpPriority=$PHP_MAJOR_VERSION$PHP_MINOR_VERSION
# create versioned php fpm dir # create versioned php fpm dir
mkdir etc/php/$phpVersion mkdir etc/php/$phpVersion
mv etc/php/fpm etc/php/$phpVersion/ mv etc/php/fpm etc/php/$phpVersion/
sed -i "s|PHPVERSION|$phpVersion|g" etc/php/$phpVersion/fpm/pool.d/vpanel.conf
cp -a etc/* /etc/ cp -a etc/* /etc/
chmod 440 /etc/sudoers.d/vpanel chmod 440 /etc/sudoers.d/vpanel
sed -i "s|;process_control_timeout = 0|process_control_timeout = 1s|g" /etc/php/$phpVersion/fpm/php-fpm.conf sed -i "s|;process_control_timeout = 0|process_control_timeout = 1s|g" /etc/php/$phpVersion/fpm/php-fpm.conf
sed -i "s|PHPVERSION|$phpVersion|g" /etc/php/$phpVersion/fpm/php-fpm.conf service php$phpVersion-fpm restart
phpPriority=$PHP_MAJOR_VERSION$PHP_MINOR_VERSION
update-alternatives --install /run/php/php-fpm-vpanel.sock php-fpm-vpanel.sock /run/php/php$phpVersion-fpm-vpanel.sock $phpPriority update-alternatives --install /run/php/php-fpm-vpanel.sock php-fpm-vpanel.sock /run/php/php$phpVersion-fpm-vpanel.sock $phpPriority
a2enconf vpanel a2enconf vpanel
service php$phpVersion-fpm restart
service apache2 restart service apache2 restart
systemctl enable vpanel-php-fpm-socket-helper.service systemctl enable vpanel-php-fpm-socket-helper.service
cp -a panel /srv/www/html/ cp -a panel /srv/www/html/