Skip to content

Commit

Permalink
Support for Alpine Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel-Nashed committed Sep 22, 2024
1 parent 0012cce commit 0551a74
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 9 deletions.
19 changes: 12 additions & 7 deletions domdownload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

###########################################################################
# Domino Software Download Script #
# Version 1.0.3 21.07.2024 #
# Version 1.0.5 22.09.2024 #
# Copyright Nash!Com, Daniel Nashed #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
Expand Down Expand Up @@ -46,11 +46,12 @@
# 1.0.2 Add redirect support for custom download option
# 1.0.3 Add support for direct download specifying -filename & -fileid and -hash
# 1.0.4 Add error checks for fileURL results specially for license accept returned errors
# 1.0.5 Support for Alpine Linux

SCRIPT_NAME=$0
SCRIPT_DIR=$(dirname $SCRIPT_NAME)

DOMDOWNLOAD_SCRIPT_VERSION=1.0.4
DOMDOWNLOAD_SCRIPT_VERSION=1.0.5

# Just print version and exit
case "$1" in
Expand Down Expand Up @@ -300,8 +301,8 @@ install_package()

$SUDO /usr/bin/apt-get install -y "$@"

elif [ -x /sbin/apk]; then
$SUDO /sbin/apk add "$@"
elif [ -x /sbin/apk ]; then
$SUDO /sbin/apk add "$@"

else

Expand Down Expand Up @@ -471,13 +472,17 @@ CheckEnvironment()

else

CHECKSUM_VERSION=$(sha256sum --version 2>/dev/null | head -1)
CHECKSUM_CMD="sha256sum"
if [ -x /usr/bin/sha256sum ]; then
CHECKSUM_CMD="/usr/bin/sha256sum"
elif [ -x /usr/local/bin/sha256sum ]; then
CHECKSUM_CMD="/usr/local/bin/sha256sum"
fi

if [ -z "$CHECKSUM_VERSION" ]; then
if [ -z "$CHECKSUM_CMD" ]; then
LogError "No sha256sum found"
exit 1
fi

fi

if [ -e /usr/bin/curl ]; then
Expand Down
33 changes: 31 additions & 2 deletions install_container_env.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/bash
#!/bin/sh

############################################################################
# Copyright Nash!Com, Daniel Nashed 2022-2024 - APACHE 2.0 see LICENSE
############################################################################

# Container environment installation script
# Version 1.0.2 24.08.2024
# Version 1.0.3 22.09.2024

# - Installs required software
# - Adds notes:notes user and group
Expand Down Expand Up @@ -180,6 +180,10 @@ linux_update()

apt-get upgrade -y

elif [ -x /sbin/apk ]; then
header "Updating Linux via apk"
apk update

fi
}

Expand Down Expand Up @@ -341,6 +345,9 @@ install_software()
# Ubuntu needs different packages and doesn't provide some others
install_package bind9-utils

elif [ -x /sbin/apk ]; then
install_packages bash outils-sha256 curl gettext gawk openssl shadow

else

# RHEL/CentOS/Fedora
Expand Down Expand Up @@ -471,6 +478,24 @@ install_container_env()

# install_packages docker.io docker-buildx docker-compose-v2

elif [ -x /sbin/apk ]; then

# Alpine Linux Docker install
install_package docker

header "Enabling and starting Docker"

if [ -x /sbin/openrc ]; then
header "Enabling and starting Docker"
openrc default
rc-service docker start

rc-update add docker default
openrc default
fi

return 0

else
# Assume Redhat/CentOS compatible environments

Expand Down Expand Up @@ -512,6 +537,10 @@ must_be_root()
return 0
fi

if [ "$(id -u)" = "0" ]; then
return 0
fi

log_error "Installation requires root permissions. Switch to root or try 'sudo'"
exit 1
}
Expand Down

0 comments on commit 0551a74

Please sign in to comment.