Skip to content

Instantly share code, notes, and snippets.

@bussnet
Created March 27, 2014 09:02
Show Gist options
  • Save bussnet/9803348 to your computer and use it in GitHub Desktop.
Save bussnet/9803348 to your computer and use it in GitHub Desktop.
upgrade the installed imscp top the latest version
#!/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