Skip to content

Commit

Permalink
Merge branch 'hotfix/1.0.1'
Browse files Browse the repository at this point in the history
* hotfix/1.0.1:
  Fix path to update.sh for inital download
  • Loading branch information
K-Ko committed Sep 19, 2017
2 parents 2f30489 + 443779a commit ef6ca3f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 1 addition & 3 deletions bin/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,18 @@ eval $(grep -v '^;' $cfg | sed 's/ *\(=\) */\1/g')

### Temp file for download
new=$(mktemp)
trap "rm $new >/dev/null 2>&1" 0
trap 'rm $new >/dev/null &>/dev/null' 0

### Fetch latest Adminer for MySQL only
wget -qO $new http://www.adminer.org/$version

### Check if the download was successful
### (sometimes the downlaoded file is empty, I think it happens on timeouts)
if [ -s $new ]; then

### Change attributes and owner to the same as index.php
chmod --reference=$path/index.php $new
chown --reference=$path/index.php $new

### Move the just downloaded file to its correct name
mv $new $path/adminer.php

fi
5 changes: 3 additions & 2 deletions public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@

if (!file_exists('../adminer.php')) {
// Load inital
exec('bin/update.sh');
die(header('Location: '.$_SERVER['REQUEST_URI']));
exec('../bin/update.sh');
die('<html><head><meta http-equiv="refresh" content="0"></head>' .
'<body></body></html>');
}

/**
Expand Down

0 comments on commit ef6ca3f

Please sign in to comment.