Update configure script to support other os than Debian/Ubuntu
This commit is contained in:
parent
71aaa7f03b
commit
d2f32b8f08
2 changed files with 7 additions and 38 deletions
|
@ -14,39 +14,10 @@ echo "=============== TIPI ================="
|
|||
echo "======================================"
|
||||
echo
|
||||
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y jq coreutils ca-certificates curl gnupg lsb-release
|
||||
|
||||
LSB="$(lsb_release -is)"
|
||||
|
||||
# Add docker gpg key (Debian)
|
||||
if [[ "${LSB}" == "Debian" ]]; then
|
||||
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
|
||||
fi
|
||||
|
||||
# Add docker gpg key (Ubuntu)
|
||||
if [[ "${LSB}" == "Ubuntu" ]]; then
|
||||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
|
||||
fi
|
||||
|
||||
# Add deb repo for docker (Debian)
|
||||
if [[ "${LSB}" == "Debian" ]]; then
|
||||
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list >/dev/null
|
||||
fi
|
||||
|
||||
# Add deb repo for docker (Ubuntu)
|
||||
if [[ "${LSB}" == "Ubuntu" ]]; then
|
||||
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list >/dev/null
|
||||
fi
|
||||
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y docker-ce docker-ce-cli containerd.io
|
||||
|
||||
# Install docker compose if not here
|
||||
if ! command -v docker-compose >/dev/null; then
|
||||
sudo curl -L "https://github.com/docker/compose/releases/download/v2.3.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
|
||||
sudo chmod +x /usr/local/bin/docker-compose
|
||||
fi
|
||||
sudo wget -O /usr/local/bin/pacapt https://github.com/icy/pacapt/raw/ng/pacapt
|
||||
sudo chmod 755 /usr/local/bin/pacapt
|
||||
sudo ln -sv /usr/local/bin/pacapt /usr/local/bin/pacman || true
|
||||
sudo pacapt -Sy; sudo pacapt -S docker docker-ce docker-compose containerd.io jq coreutils curl -y
|
||||
|
||||
# Create configured status
|
||||
touch "${ROOT_FOLDER}/state/configured"
|
||||
|
|
|
@ -120,11 +120,6 @@ fi
|
|||
# Get dns ip if pihole is installed
|
||||
str=$(get_json_field ${STATE_FOLDER}/apps.json installed)
|
||||
|
||||
# if pihole is present in str add it as DNS
|
||||
# if [[ $str = *"pihole"* ]]; then
|
||||
# DNS_IP=10.21.21.201
|
||||
# fi
|
||||
|
||||
# Create seed file with cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1
|
||||
if [[ ! -f "${STATE_FOLDER}/seed" ]]; then
|
||||
echo "Generating seed..."
|
||||
|
@ -167,6 +162,9 @@ mv -f "$ENV_FILE" "$ROOT_FOLDER/.env"
|
|||
echo "Running system-info.sh..."
|
||||
bash "${ROOT_FOLDER}/scripts/system-info.sh"
|
||||
|
||||
# Add crontab to run system-info.sh every minute
|
||||
! (crontab -l | grep -q "${ROOT_FOLDER}/scripts/system-info.sh") && (crontab -l; echo "* * * * * ${ROOT_FOLDER}/scripts/system-info.sh") | crontab -
|
||||
|
||||
## Don't run if config-only
|
||||
if [[ ! $ci == "true" ]]; then
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue