=== removed file 'home/container-setup' --- old/home/container-setup 2022-10-13 13:29:52 +0000 +++ new/home/container-setup 1970-01-01 00:00:00 +0000 @@ -1,49 +0,0 @@ -#!/bin/zsh -setopt no_unset extended_glob warn_create_global -typeset -g DSTROOT CONTAINER_NAME REPO_ROOT -set -x -DSTROOT=$1 -CONTAINER_NAME=$2 -REPO_ROOT=${0:P:h:h} - -die() { - printf >&2 "FATAL: %s\n" "$@" - exit 1 -} - -ensure-container-started() { - [[ $1 == */* ]] && die "Invalid container name: ${(qqq)1}" - s6-svc -wU -T 4000 -o /run/service/container.$1.$USER -} - -setup-sndio() { - local sndio_container=alpine-sndio.$USER - local sndio_dir=$DSTROOT/inbox/$sndio_container/sndio-$UID - s6-svc -wU -T 4000 -o /run/service/container.$sndio_container || exit $? - mkdir -p $sndio_dir || exit $? - ln -fv /run/containers/$sndio_container/tmp/sndio-$UID/sock{0,1} $sndio_dir/ || exit $? -} - -setup-gpg-agent() { - ln -fv /run/user/$UID/gpg-agent-ssh.sock $DSTROOT/inbox/ || exit $? - ln -fv /run/user/$UID/gpg-agent.sock $DSTROOT/inbox/ || exit $? -} - -main() { - if ! [[ -d $DSTROOT ]]; then - echo >&2 "Destination root not a directory: $DSTROOT" - exit 2 - fi - - case $CONTAINER_NAME in - (void-recombee-browser|void-mpd) - setup-sndio - ;; - (alpine-recombee) - setup-gpg-agent - ;; - esac - return 0 -} - -main