Created
January 29, 2015 23:19
-
-
Save pguelpa/d7489184a124f3f75fa2 to your computer and use it in GitHub Desktop.
"rebalance" fleet units
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -e | |
if [ ! -z ${DEBUG+x} ] | |
then | |
set -x | |
fi | |
if [ $# -eq 0 ] | |
then | |
echo "Usage: $0 unit ..." | |
exit 1 | |
fi | |
tmpdir=$(mktemp -d -t fleet) | |
for unit in "$@" | |
do | |
echo "Writing ${unit} to ${tmpdir}/${unit}" | |
fleetctl cat $unit > $tmpdir/$unit | |
fleetctl destroy $unit | |
fleetctl start $tmpdir/$unit | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment