Skip to content

Instantly share code, notes, and snippets.

@K-Ko
Last active August 29, 2015 14:06
Show Gist options
  • Save K-Ko/5e05fe812f6a74849aa5 to your computer and use it in GitHub Desktop.
Save K-Ko/5e05fe812f6a74849aa5 to your computer and use it in GitHub Desktop.
Hold Adminer up-to-date
#!/bin/bash
### Set pathe to Adminer document root
path=/var/www/html/adminer/public_html
### Fetch latest Adminer for MySQL only
wget -qO $path/.new http://www.adminer.org/latest-mysql.php
### Check if the download was successful and move the just downloaded file to its correct name
### (sometimes the downlaoded file is empty, I think it happens on timeouts)
find $path -name .new -not -empty -exec mv {} $path/adminer.php \;
### Change owner to the web server running user
chown www-data:www-data $path/adminer.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment