#!/bin/bash
# Change MySQL password 

PASS=$(mcookie)
CONF=/var/www/data/include/GLOBALS.php

# Change password in FUDforum's GLOBALS.php file
# Original line: $DBHOST_PASSWORD        = 'fudforum';
sed -ri "s/DBHOST_PASSWORD(\s+)=(\s+)'.*';/DBHOST_PASSWORD\\1=\\2'$PASS';/" $CONF

# Change the MySQL user's password
/usr/lib/di-live.d/??mysql-conf -u fudforum -p $PASS --chroot=/

