use bash because sh may not set HOSTNAME; remove "-*" suffixes from HOSTNAME only if they are "-a" or "-b"
--- a/debian/ha-sync.config Tue Nov 29 16:09:06 2011 +0100
+++ b/debian/ha-sync.config Wed Nov 30 10:38:04 2011 +0100
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
set -e
. /usr/share/debconf/confmodule
@@ -9,7 +9,7 @@
db_input high ha-sync/dir || true
-HOSTNAME=${HOSTNAME%-*}
+HOSTNAME=${HOSTNAME%-[ab]}
NODES="$HOSTNAME-a $HOSTNAME-b"
db_set ha-sync/nodes "$NODES"
db_input high ha-sync/nodes || true