Skip to content

Commit

Permalink
Adding removal of getdownload.php to ensure that if users who upgrade…
Browse files Browse the repository at this point in the history
… from 10.0.2 to 10.1.0 and didn't follow our manual patch advice this is now automatically taken care of during the upgrade.
  • Loading branch information
allebb committed Oct 28, 2013
1 parent cca4eb6 commit c2d9435
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ genpasswd() {
result=`mysql -u postfix -ppostfix --skip-column-names -e "SHOW DATABASES LIKE 'zpanel_postfix'"`

if [ "$result" == "zpanel_postfix" ]; then

password=`genpasswd`;
mysqlrootpass=`cat /root/mysqlrootpass`
echo "UPDATE mysql.user SET Password=PASSWORD('$password') WHERE User='postfix' AND Host='localhost';" | mysql -u root -p$mysqlrootpass
echo "FLUSH PRIVILEGES;" | mysql -u root -p$mysqlrootpass

sed -i "s|password \= postfix|password \= $password|" /etc/zpanel/configs/postfix/mysql-relay_domains_maps.cf
sed -i "s|password \= postfix|password \= $password|" /etc/zpanel/configs/postfix/mysql-virtual_alias_maps.cf
sed -i "s|password \= postfix|password \= $password|" /etc/zpanel/configs/postfix/mysql-virtual_domains_maps.cf
Expand All @@ -27,4 +27,6 @@ if [ "$result" == "zpanel_postfix" ]; then
sed -i "s|password=postfix|password=$password|" /etc/zpanel/configs/dovecot2/dovecot-mysql.conf
echo -e "Your new MySQL 'postfix' is : $password";
echo -e "MySQL Postfix Password : $password" >> /root/passwords.txt
fi
fi

rm /etc/zpanel/panel/modules/backupmgr/code/getdownload.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ genpasswd() {
result=`mysql -u postfix -ppostfix --skip-column-names -e "SHOW DATABASES LIKE 'zpanel_postfix'"`

if [ "$result" == "zpanel_postfix" ]; then

password=`genpasswd`;
mysqlrootpass=`cat /root/mysqlrootpass`
echo "UPDATE mysql.user SET Password=PASSWORD('$password') WHERE User='postfix' AND Host='localhost';" | mysql -u root -p$mysqlrootpass
echo "FLUSH PRIVILEGES;" | mysql -u root -p$mysqlrootpass

sed -i "s|password \= postfix|password \= $password|" /etc/zpanel/configs/postfix/mysql-relay_domains_maps.cf
sed -i "s|password \= postfix|password \= $password|" /etc/zpanel/configs/postfix/mysql-virtual_alias_maps.cf
sed -i "s|password \= postfix|password \= $password|" /etc/zpanel/configs/postfix/mysql-virtual_domains_maps.cf
Expand All @@ -27,4 +27,6 @@ if [ "$result" == "zpanel_postfix" ]; then
sed -i "s|password=postfix|password=$password|" /etc/zpanel/configs/dovecot2/dovecot-mysql.conf
echo -e "Your new MySQL 'postfix' is : $password";
echo -e "MySQL Postfix Password : $password" >> /root/passwords.txt
fi
fi

rm /etc/zpanel/panel/modules/backupmgr/code/getdownload.php

0 comments on commit c2d9435

Please sign in to comment.