Skip to content

Instantly share code, notes, and snippets.

@theemstra
Forked from bussnet/imscp_upgrade
Last active August 29, 2015 14:17
Show Gist options
  • Save theemstra/353d7faf834ddca08d01 to your computer and use it in GitHub Desktop.
Save theemstra/353d7faf834ddca08d01 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Install and download the latest Version of IMSCP
LATEST_VERSION=$(curl -s https://github.com/i-MSCP/imscp/releases/latest|grep -Po '(?<=/tag/)[0-9.]+')
INSTALLED_VERSION=$(cat /etc/imscp/imscp.conf|grep -Po '(?<=Version = )[0-9.]+')
TARGET=/usr/local/src/
echo "installed imscp-version: $INSTALLED_VERSION"
echo "latest imscp-version: $LATEST_VERSION"
# check if Versions are equal
if [ "$LATEST_VERSION" = "$INSTALLED_VERSION" ]; then
echo "latest version installed - exit"
exit 0
fi
# download if not exists
if [ ! -d "$TARGET/imscp-$LATEST_VERSION" ]; then
echo 'download latest version...'
curl -Ls https://github.com/i-MSCP/imscp/archive/$LATEST_VERSION.tar.gz | tar xz -C $TARGET
fi
echo 'install latest version...'
perl $TARGET/imscp-$LATEST_VERSION/imscp-autoinstall -n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment