This repository has been archived on 2020-01-17. You can view files and clone it, but cannot push or open issues or pull requests.
vn-repo/vn-deploy

31 lines
591 B
Bash
Executable File

#!/bin/bash
set -e
hosts="$@"
if [ -z "$hosts" ]; then
echo "Usage: $(basename $0) [user1@]host1 [[user2@]host2]..."
exit 1
fi
packages=""
while read -r line; do
packageName=$(echo $line | cut -d"_" -f1)
packages="$packages $packageName"
done < "$PWD/debian/files"
if [ -z "$packages" ]; then
echo "No packages found to install."
exit 1
fi
# FIXME: Packages are not upgraded when config files are changed
echo -e "\n# Upgrading servers\n"
for host in $hosts; do
echo " * Upgrading $host"
ssh $host "update-repo vn && apt-get --quiet --yes install $packages"
done