debian/postinst
changeset 37 1cdaa46b79c5
parent 1 b36b9eee9c41
child 38 5c262b6a659d
equal deleted inserted replaced
36:c45ea25f852c 37:1cdaa46b79c5
     1 #!/bin/sh
     1 #!/bin/bash
     2 # postinst script for ha-sync
     2 # postinst script for ha-sync
     3 #
     3 #
     4 # see: dh_installdeb(1)
     4 # see: dh_installdeb(1)
     5 set -e
     5 set -e
     6 . /usr/share/debconf/confmodule
     6 . /usr/share/debconf/confmodule
    20 
    20 
    21 case "$1" in
    21 case "$1" in
    22     configure)
    22     configure)
    23 
    23 
    24 	{
    24 	{
    25 	    update-rc.d ha-hostname start 3 S . 
    25 	    insserv ha-hostname
    26 	    update-rc.d ha-config start 30 S . 
    26 	    insserv ha-config
    27 
    27 
    28 	    test -f /etc/ha-sync/id_rsa || {
    28 	    test -f /etc/ha-sync/id_rsa || {
    29 		    ssh-keygen -N "" -C "ha-sync@`hostname`" -f /etc/ha-sync/id_rsa >&2
    29 		    ssh-keygen -N "" -C "ha-sync@`hostname`" -f /etc/ha-sync/id_rsa >&2
    30 		    chmod u=r,go= /etc/ha-sync/id_rsa
    30 		    chmod u=r,go= /etc/ha-sync/id_rsa
    31 	    }
    31 	    }
    55 
    55 
    56 	    db_get ha-sync/exclude
    56 	    db_get ha-sync/exclude
    57 	    echo EXCLUDE="'$RET'"
    57 	    echo EXCLUDE="'$RET'"
    58 
    58 
    59 	} >> $TMP
    59 	} >> $TMP
    60 	ucf $TMP /etc/ha-sync/ha-sync.conf
    60 	ucf --debconf-ok $TMP /etc/ha-sync/ha-sync.conf
    61 
    61 
    62 	## Exclude list
    62 	## Exclude list
    63 	ucf /usr/share/doc/ha-sync/examples/exclude.ex /etc/ha-sync/exclude
    63 	ucf --debconf-ok /usr/share/doc/ha-sync/examples/exclude.ex /etc/ha-sync/exclude
    64 
    64 
    65 	## noch Verzeichnisse
    65 	## noch Verzeichnisse
    66 	source /etc/ha-sync/ha-sync.conf
    66 	source /etc/ha-sync/ha-sync.conf
    67 	install -d "$DIR";
    67 	install -d "$DIR";
    68 	for node in $NODE_A $NODE_B; do
    68 	for node in $NODE_A $NODE_B; do