Skip to content

Instantly share code, notes, and snippets.

@andresvia
Created April 22, 2015 00:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andresvia/13ddbe43d349636dd9e3 to your computer and use it in GitHub Desktop.
Save andresvia/13ddbe43d349636dd9e3 to your computer and use it in GitHub Desktop.
#!/bin/bash -e
my_vars="MYSQL_SERVER MYSQL_DATABASE MYSQL_USER MYSQL_PASSWORD EXTERNAL_ENV"
for var in ${my_vars}
do
if [ -z "${!var}" ]
then
echo "No ${var} defined"
exit 1
fi
val="${!var}"
sed -i "s|{${var}}|${val}|g" /etc/zabbix/zabbix_server.conf /usr/local/lib/zabbix/alertscripts/*
done
# cleaning up "puppet apply" residues
rm /var/run/pdagent/pdagentd.pid
# these processes daemonize themselves
/usr/sbin/zabbix_server
su -s /bin/sh -c /usr/share/pdagent/bin/pdagentd.py pdagent
# if supervisord is started with exec it will reap any
# unknown process
/usr/bin/supervisord -c /etc/supervisor/supervisord.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment