Skip to content

Instantly share code, notes, and snippets.

@Lucho00Cuba
Created March 28, 2023 19:02
Show Gist options
  • Select an option

  • Save Lucho00Cuba/bd0d94fd9c12d7dd745cb783447f4bf2 to your computer and use it in GitHub Desktop.

Select an option

Save Lucho00Cuba/bd0d94fd9c12d7dd745cb783447f4bf2 to your computer and use it in GitHub Desktop.
GetXamppLinux
#!/usr/bin/env bash
PLATFORM="linux"
ARCH="x64"
VERSION="8.0.25"
INSTALLER="xampp-${PLATFORM}-${ARCH}-${VERSION}-0-installer.run"
cmd(){
if [[ "$($1 &>/dev/null; echo $?)" == "0" ]]; then
logger "info" "$2"
else
logger "error" "$3"
fi
}
logger(){
echo -e "[${1^^}] - $(date "+%Y.%m.%d-%H:%M:%S %Z") - $2"
}
if [[ $UID == "0" ]]; then
logger "info" "downloading xampp...be patient"
cmd "wget https://nav.dl.sourceforge.net/project/xampp/XAMPP%20Linux/${VERSION}/${INSTALLER}" "download xampp"
cmd "chmod +x $INSTALLER" "set permission execute"
./${INSTALLER}
rm ${INSTALLER}
else
echo "execute as root"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment