Skip to content

Instantly share code, notes, and snippets.

@pguelpa
Created January 29, 2015 23:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save pguelpa/d7489184a124f3f75fa2 to your computer and use it in GitHub Desktop.
Save pguelpa/d7489184a124f3f75fa2 to your computer and use it in GitHub Desktop.
"rebalance" fleet units
#!/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