This commit is contained in:
Bozhidar Slaveykov 2023-11-23 20:13:24 +02:00
parent 974002c0d3
commit b8919ceb0d
4 changed files with 59 additions and 0 deletions

View file

@ -0,0 +1,29 @@
#!/bin/bash
HELPERS_DIR="$(dirname "$(pwd)")/shell/helpers/ubuntu"
. $HELPERS_DIR"/common.sh"
# Update the system
#apt update && apt upgrade -y
DEPENDENCIES_LIST=(
"curl"
"wget"
"git"
"nodejs"
"npm"
"unzip"
"zip"
"tar"
"php"
)
# Check if the dependencies are installed
for DEPENDENCY in "${DEPENDENCIES_LIST[@]}"; do
if ! command_is_installed $DEPENDENCY; then
echo "Dependency $DEPENDENCY is not installed."
echo "Installing $DEPENDENCY..."
apt install -y $DEPENDENCY
else
echo "Dependency $DEPENDENCY is installed."
fi
done

View file

@ -30,3 +30,19 @@ if [[ $(cat /etc/os-release | grep -w "ID_LIKE" | cut -d "=" -f 2) != "debian" ]
exit 1 exit 1
fi fi
# Check if the user is running a supported distro version
DISTRO_VERSION=$(cat /etc/os-release | grep -w "VERSION_ID" | cut -d "=" -f 2)
DISTRO_VERSION=${DISTRO_VERSION//\"/} # Remove quotes from version string
DISTRO_NAME=$(cat /etc/os-release | grep -w "NAME" | cut -d "=" -f 2)
DISTRO_NAME=${DISTRO_NAME//\"/} # Remove quotes from name string
DISTRO_INSTALLER_FILE="./${DISTRO_NAME}/${DISTRO_VERSION}/install.sh"
if [[ ! -f $DISTRO_INSTALLER_FILE ]]; then
echo "AlphaXPanel not supporting this version of distribution"
echo "Distro: ${DISTRO_NAME} Version: ${DISTRO_VERSION}"
echo "Exiting..."
# exit 1
fi
bash $DISTRO_INSTALLER_FILE

View file

@ -0,0 +1,14 @@
#!/bin/bash
function command_is_installed() {
CHECK_COMMAND=$1
if [[ $(command -v $CHECK_COMMAND) == "" ]]; then
return 1
else
return 0
fi
}