phpMyAdmin upgrade script.

I got sick of upgrading phpMyAdmin at work every time a new version came out so i made this little script to do it for me. All you have to do is pass the .gz download url to it.

Here is the code:

upgrade() {
    wget $1 -O phpmyadminupgrade.tar.gz
    tar zxvf $FILE
    FOLDER=`echo $FILE | awk -F".tar" '{print $1}'`
    cp /usr/share/phpmyadmin/ ~/phpMyAdmin*
    rm -rf /usr/share/phpmyadmin/*
    cp -R ~/phpMyAdmin*/* /usr/share/phpmyadmin/
    chmod -R 777 /usr/share/phpmyadmin/
    chmod 644 /usr/share/phpmyadmin/
    rm -rf ~/phpMyAdmin*
    rm ~/$FILE
    echo "Done!!"
    exit 1

usage() {
    echo "Use this script to update phpmyadmin"
    echo "to run:"
    echo "./ url"
    exit 1

if [ -z "$1" ]; then
    upgrade $1

Past that into “”
chmod a+x it and run it as root like so:

user@user:~$ sudo ./ url

NOTE: This bash script assumes phpMyAdmin’s html files, including live in /usr/share/phpmyadmin/ and that you are running this script in your home directory.