#!/bin/bash kill -s $(keepalived --signum=DATA) $(cat /var/run/keepalived.pid) STATE=$(cat /tmp/keepalived.data |grep MASTER) if [[ -z "${STATE}" ]]; then echo "This is a secondary backup server, run the script on current master" else python3 n_gen.py fi