Skip to content

Instantly share code, notes, and snippets.

@paul1522
Last active January 21, 2021 23:31
Show Gist options
  • Save paul1522/c57aa5bbd44fab8370b860754c307acd to your computer and use it in GitHub Desktop.
Save paul1522/c57aa5bbd44fab8370b860754c307acd to your computer and use it in GitHub Desktop.
Bash script to download the latest version of adminer from https://www.adminer.org/
#!/bin/bash
## Figure out what the latest version is and download it, if needed.
CURVER=`wget -qO- https://www.adminer.org/ | perl -ne 'if (m/adminer-([0-9\.]+)\.php/s) { print "$1\n"; exit }'`
[ -f adminer-$CURVER.php ] || wget https://github.com/vrana/adminer/releases/download/v$CURVER/adminer-$CURVER.php
## Symlink index.php to it.
ln -sf adminer-$CURVER.php index.php
## Get the theme switcher too.
[ -f adminer-theme-switcher.php ] || wget https://raw.githubusercontent.com/felladrin/adminer-theme-switcher/master/adminer-theme-switcher.php
## Install a dark theme, unless a theme is already installed.
[ -f adminer.css ] || wget https://raw.githubusercontent.com/vrana/adminer/master/designs/mancave/adminer.css
## Prepare to be served.
chown www-data.www-data *
chmod 770 *
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment