35 lines
562 B
Bash
Executable File
35 lines
562 B
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
|
|
hosts="$@"
|
|
|
|
if [ -z "$hosts" ]
|
|
then
|
|
echo "Usage: $(basename $0) host1 [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 root@$host "update-repo vn && apt-get install $packages"
|
|
done
|