Skip to content

Commit

Permalink
Merge pull request #71 from OlivierGuilloux/do_curl_only_if_necessary
Browse files Browse the repository at this point in the history
Do curl only if necessary
  • Loading branch information
DiouxX authored Jan 10, 2024
2 parents fdbe308 + 520c287 commit 0bb48db
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions glpi-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ echo "date.timezone = \"$TIMEZONE\"" > /etc/php/8.1/apache2/conf.d/timezone.ini;
echo "date.timezone = \"$TIMEZONE\"" > /etc/php/8.1/cli/conf.d/timezone.ini;
fi

SRC_GLPI=$(curl -s https://api.github.com/repos/glpi-project/glpi/releases/tags/${VERSION_GLPI} | jq .assets[0].browser_download_url | tr -d \")
TAR_GLPI=$(basename ${SRC_GLPI})
FOLDER_GLPI=glpi/
FOLDER_WEB=/var/www/html/

Expand All @@ -27,6 +25,9 @@ if [ "$(ls ${FOLDER_WEB}${FOLDER_GLPI})" ];
then
echo "GLPI is already installed"
else
SRC_GLPI=$(curl -s https://api.github.com/repos/glpi-project/glpi/releases/tags/${VERSION_GLPI} | jq .assets[0].browser_download_url | tr -d \")
TAR_GLPI=$(basename ${SRC_GLPI})

wget -P ${FOLDER_WEB} ${SRC_GLPI}
tar -xzf ${FOLDER_WEB}${TAR_GLPI} -C ${FOLDER_WEB}
rm -Rf ${FOLDER_WEB}${TAR_GLPI}
Expand Down

0 comments on commit 0bb48db

Please sign in to comment.