use bash because sh may not set HOSTNAME; remove "-*" suffixes from HOSTNAME only if they are "-a" or "-b"
authorMatthias Förste foerste@schlittermann.de
Wed, 30 Nov 2011 10:38:04 +0100
changeset 35 9439a824f71d
parent 34 1137e5b3bf0c
child 36 c45ea25f852c
use bash because sh may not set HOSTNAME; remove "-*" suffixes from HOSTNAME only if they are "-a" or "-b"
debian/ha-sync.config
--- 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