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

36 lines
568 B
Plaintext
Raw Normal View History

2018-04-19 10:35:41 +00:00
#!/bin/bash
set -e
hosts=$1
if [ -z "$hosts" ]
then
echo "Usage: $(basename $0) host1 [host2]..."
exit 1
fi
packages=""
2018-04-19 10:45:41 +00:00
cut -d" " -f1 "$PWD/debian/files" |
2018-04-19 10:35:41 +00:00
while read debFile
do
packageName=$(echo $debFile | cut -d"_" -f1)
packages="$packages $packageName"
done
if [ -z "$packages" ]
then
echo "No packages found to install"
exit 1
fi
# FIXME: Packages are not upgraded when config files are changed
echo "Upgrading servers."
for host in $hosts
do
echo " * Upgrading $host"
ssh root@$host "update-repo vn && apt-get install $packages"
done