fix sed
This commit is contained in:
parent
b779b4d438
commit
b6fdec0d09
|
@ -10,15 +10,15 @@ if [ ! -e "$FIRST_START_DONE" ]; then
|
||||||
#
|
#
|
||||||
# bootstrap config
|
# bootstrap config
|
||||||
#
|
#
|
||||||
sed -i --follow-symlinks --follow-symlinks "s|{{ keepalived_interface }}|$KEEPALIVED_INTERFACE|g" /etc/keepalived/keepalived.conf
|
sed -i --follow-symlinks "s|{{ keepalived_interface }}|$KEEPALIVED_INTERFACE|g" /etc/keepalived/keepalived.conf
|
||||||
sed -i --follow-symlinks --follow-symlinks "s|{{ keepalived_priority }}|$KEEPALIVED_PRIORITY|g" /etc/keepalived/keepalived.conf
|
sed -i --follow-symlinks "s|{{ keepalived_priority }}|$KEEPALIVED_PRIORITY|g" /etc/keepalived/keepalived.conf
|
||||||
sed -i --follow-symlinks --follow-symlinks "s|{{ keepalived_password }}|$KEEPALIVED_PASSWORD|g" /etc/keepalived/keepalived.conf
|
sed -i --follow-symlinks "s|{{ keepalived_password }}|$KEEPALIVED_PASSWORD|g" /etc/keepalived/keepalived.conf
|
||||||
|
|
||||||
if [ -n "$KEEPALIVED_NOTIFY" ]; then
|
if [ -n "$KEEPALIVED_NOTIFY" ]; then
|
||||||
sed -i --follow-symlinks --follow-symlinks "s|{{ keepalived_notify }}|notify \"$KEEPALIVED_NOTIFY\"|g" /etc/keepalived/keepalived.conf
|
sed -i --follow-symlinks "s|{{ keepalived_notify }}|notify \"$KEEPALIVED_NOTIFY\"|g" /etc/keepalived/keepalived.conf
|
||||||
chmod +x $KEEPALIVED_NOTIFY
|
chmod +x $KEEPALIVED_NOTIFY
|
||||||
else
|
else
|
||||||
sed -i --follow-symlinks --follow-symlinks "/{{ keepalived_notify }}/d" /etc/keepalived/keepalived.conf
|
sed -i --follow-symlinks "/{{ keepalived_notify }}/d" /etc/keepalived/keepalived.conf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# unicast peers
|
# unicast peers
|
||||||
|
@ -28,13 +28,13 @@ if [ ! -e "$FIRST_START_DONE" ]; then
|
||||||
# it's just a peer
|
# it's just a peer
|
||||||
# stored in a variable
|
# stored in a variable
|
||||||
if [ -n "${!peer}" ]; then
|
if [ -n "${!peer}" ]; then
|
||||||
sed -i --follow-symlinks --follow-symlinks "s|{{ keepalived_unicast_peers }}|${!peer}\n {{ keepalived_unicast_peers }}|g" /etc/keepalived/keepalived.conf
|
sed -i --follow-symlinks "s|{{ keepalived_unicast_peers }}|${!peer}\n {{ keepalived_unicast_peers }}|g" /etc/keepalived/keepalived.conf
|
||||||
# directly
|
# directly
|
||||||
else
|
else
|
||||||
sed -i --follow-symlinks --follow-symlinks "s|{{ keepalived_unicast_peers }}|${peer}\n {{ keepalived_unicast_peers }}|g" /etc/keepalived/keepalived.conf
|
sed -i --follow-symlinks "s|{{ keepalived_unicast_peers }}|${peer}\n {{ keepalived_unicast_peers }}|g" /etc/keepalived/keepalived.conf
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
sed -i --follow-symlinks --follow-symlinks "/{{ keepalived_unicast_peers }}/d" /etc/keepalived/keepalived.conf
|
sed -i --follow-symlinks "/{{ keepalived_unicast_peers }}/d" /etc/keepalived/keepalived.conf
|
||||||
|
|
||||||
# virtual ips
|
# virtual ips
|
||||||
KEEPALIVED_VIRTUAL_IPS=($KEEPALIVED_VIRTUAL_IPS)
|
KEEPALIVED_VIRTUAL_IPS=($KEEPALIVED_VIRTUAL_IPS)
|
||||||
|
@ -43,13 +43,13 @@ if [ ! -e "$FIRST_START_DONE" ]; then
|
||||||
# it's just a peer
|
# it's just a peer
|
||||||
# stored in a variable
|
# stored in a variable
|
||||||
if [ -n "${!vip}" ]; then
|
if [ -n "${!vip}" ]; then
|
||||||
sed -i --follow-symlinks --follow-symlinks "s|{{ keepalived_virtual_ips }}|${!vip}\n {{ keepalived_virtual_ips }}|g" /etc/keepalived/keepalived.conf
|
sed -i --follow-symlinks "s|{{ keepalived_virtual_ips }}|${!vip}\n {{ keepalived_virtual_ips }}|g" /etc/keepalived/keepalived.conf
|
||||||
# directly
|
# directly
|
||||||
else
|
else
|
||||||
sed -i --follow-symlinks --follow-symlinks "s|{{ keepalived_virtual_ips }}|${vip}\n {{ keepalived_virtual_ips }}|g" /etc/keepalived/keepalived.conf
|
sed -i --follow-symlinks "s|{{ keepalived_virtual_ips }}|${vip}\n {{ keepalived_virtual_ips }}|g" /etc/keepalived/keepalived.conf
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
sed -i --follow-symlinks --follow-symlinks "/{{ keepalived_virtual_ips }}/d" /etc/keepalived/keepalived.conf
|
sed -i --follow-symlinks "/{{ keepalived_virtual_ips }}/d" /etc/keepalived/keepalived.conf
|
||||||
|
|
||||||
touch $FIRST_START_DONE
|
touch $FIRST_START_DONE
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue