-
-
Save theemstra/353d7faf834ddca08d01 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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