set correct servername
This commit is contained in:
Родитель
1e96a3ed16
Коммит
4cab9b2512
|
@ -31,10 +31,10 @@ then
|
|||
crontab -u root -l | { cat; echo "@weekly $SCRIPTS/letsencryptrenew.sh"; } | crontab -u root -
|
||||
|
||||
# Set hostname and ServerName
|
||||
echo "Setting hostname to $1..."
|
||||
sudo sh -c "echo 'ServerName $1' >> /etc/apache2/apache2.conf"
|
||||
sudo hostnamectl set-hostname $1
|
||||
sudo -u www-data php $NCPATH/occ config:system:set trusted_domains 3 --value=$1
|
||||
FQDOMAIN=$(grep -r -m 1 ServerName /etc/apache2/sites-enabled/* | awk '{print $2}')
|
||||
echo "Setting hostname to $FQDOMAIN..."
|
||||
sudo sh -c "echo 'ServerName $FQDOMAIN' >> /etc/apache2/apache2.conf"
|
||||
sudo hostnamectl set-hostname $FQDOMAIN
|
||||
service apache2 restart
|
||||
|
||||
DATE='$(date +%Y-%m-%d_%H:%M)'
|
||||
|
|
Загрузка…
Ссылка в новой задаче