#!/bin/sh -ex w=$1 [ -n "$w" ] [ -d rc/$w.cfg ] redo $w mkdir -p updates [ -s updates/$w.old ] || { echo This is first run mv $w updates/$w.old exit } bsdiff updates/$w.old $w updates/$w.bsdiff mv updates/$w.old updates/$w.older mv $w updates/$w.old cat > updates/$w-update.sh <> updates/$w-update.sh chmod +x updates/$w-update.sh