#!/bin/sh -e version="3.21" HOSTNAME="$1" if [ -z "$HOSTNAME" ]; then echo "usage: $0 hostname" exit 1 fi cleanup() { rm -rf "$tmp" } makefile() { OWNER="$1" PERMS="$2" FILENAME="$3" cat > "$FILENAME" chown "$OWNER" "$FILENAME" chmod "$PERMS" "$FILENAME" } rc_add() { mkdir -p "$tmp"/etc/runlevels/"$2" ln -sf /etc/init.d/"$1" "$tmp"/etc/runlevels/"$2"/"$1" } tmp="$(mktemp -d)" trap cleanup EXIT mkdir -p "$tmp"/etc makefile root:root 0644 "$tmp"/etc/hostname < /etc/sudoers.d/\$user && chmod 0440 /etc/sudoers.d/\$user # Podman rootless support modprobe tun echo tun >> /etc/modules echo \$user:100000:65536 >> /etc/subuid echo \$user:100000:65536 >> /etc/subgid EOF mkdir -p "$tmp"/usr/bin makefile root:root 0755 "$tmp"/usr/bin/alpdock-run-portainer < $HOSTNAME.apkovl.tar.gz