server-scripts/package-add
2018-09-13 07:43:21 +00:00

19 lines
497 B
Bash
Executable File

#!/usr/bin/env bash
set -e
if [[ "$#" < 1 ]]; then
echo "USAGE: $0 packages..."
fi
pkgs=""
for pkg in "$@"
do
cp -- "$pkg" "/lxc/login/rootfs/var/lib/aurrepo/"
name="$(basename $pkg)"
chown 102013:102013 "/lxc/login/rootfs/var/lib/aurrepo/$name"
lxc-attach -n login -- sudo -u aurrepo gpg --detach-sign --no-armor "/var/lib/aurrepo/$name"
pkgs="$pkgs /var/lib/aurrepo/$name"
done
lxc-attach -n login -- pacman -U $pkgs
lxc-attach -n login -- sudo -u aurrepo aurrepo --sign --verbose