Hi,
I revert the server.
I was anylizing the log and have some questions:
Why this?
None of my servers has a /etc/hostname file.....? So thats not gone work for me.
Next:
Why all this trouble? Why not leave al as it is? After all your are updating a working Zpanel server. No need for changing al this, everyone howm has custom edits to these files will get trouble.
Something wnt worng for me here:?
so this:
screwed the rest of the update for me up. Somehow it did nog get the ZPanel Root Mysql password right.
I revert the server.
I was anylizing the log and have some questions:
Why this?
Code:
old_hostname=$(cat /etc/hostname)
# In file hostname
echo "$PANEL_FQDN" > /etc/hostname
None of my servers has a /etc/hostname file.....? So thats not gone work for me.
Next:
Code:
#--- Resolv.conf protect
chattr +i /etc/resolv.conf
#--- Prepare hostname
old_hostname=$(cat /etc/hostname)
# In file hostname
echo "$PANEL_FQDN" > /etc/hostname
# In file hosts
sed -i "/127.0.1.1[\t ]*$old_hostname/d" /etc/hosts
sed -i "s|$old_hostname|$PANEL_FQDN|" /etc/hosts
# For current session
hostname "$PANEL_FQDN"
# In network file
if [[ "$OS" = "CentOs" && "$VER" = "6" ]]; then
sed -i "s|^\(HOSTNAME=\).*\$|HOSTNAME=$PANEL_FQDN|" /etc/sysconfig/network
/etc/init.d/network restart
fi
Something wnt worng for me here:?
Code:
mysqlpassword=$(cat /etc/sentora/panel/cnf/db.php | grep "pass" | cut -d \' -f 2);
Code:
if [ -z "$mysqlpassword" ]; then
mysqlpassword=$(passwordgen);
mysqladmin -u root password "$mysqlpassword"
fi