Enable alpine base image compatibility

This commit is contained in:
Jendrik Weise
2023-08-11 13:48:51 +02:00
parent c7dea757b9
commit d0868082e4
2 changed files with 27 additions and 5 deletions
@@ -1,10 +1,24 @@
#!/usr/bin/with-contenv bash
for package in iputils-ping openssh-client python3-click python3-yaml wakeonlan; do
if ! dpkg -s "${package}" >/dev/null 2>&1; then
PACKAGES="${package} ${PACKAGES}"
## Ubuntu
if [ -f /usr/bin/apt ]; then
for package in iputils-ping openssh-client python3-click python3-yaml python3 wakeonlan; do
if ! dpkg -s "${package}" >/dev/null 2>&1; then
PACKAGES="${package} ${PACKAGES}"
fi
done
fi
# Alpine
if [ -f /sbin/apk ]; then
if ! grep -qxF '@testing https://dl-cdn.alpinelinux.org/alpine/edge/testing' /etc/apk/repositories; then
echo @testing https://dl-cdn.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories
fi
done
for package in openssh py3-click py3-yaml python3 wol@testing; do
if ! apk info -e "${package}" >/dev/null 2>&1; then
PACKAGES="${package} ${PACKAGES}"
fi
done
fi
if [ -n "${PACKAGES}" ]; then
echo "${PACKAGES}" >> /mod-repo-packages-to-install.list