From 46c93bb54e942e45b7e4b78b836b39e827fe547d Mon Sep 17 00:00:00 2001 From: swysor Date: Fri, 27 Oct 2017 14:23:56 -0400 Subject: [PATCH] Fixed this not allowing the setting to be a comment --- system/sbin/kazoo-kamailio | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/system/sbin/kazoo-kamailio b/system/sbin/kazoo-kamailio index af4d6ef..e9333f8 100755 --- a/system/sbin/kazoo-kamailio +++ b/system/sbin/kazoo-kamailio @@ -32,7 +32,7 @@ prepare() { rm -rf ${PID_FILE} fi if ram_disk_enabled; then - if ! mount_point_exists; then + if ! mount_point_exists; then if [ -f /etc/kazoo/kamailio/kazoo.db ]; then mv /etc/kazoo/kamailio/db /etc/kazoo/kamailio/db-backup fi @@ -41,7 +41,7 @@ prepare() { cp -a /etc/kazoo/kamailio/db-backup/* /etc/kazoo/kamailio/db/ fi fi - fi + fi if [ ! -f /etc/kazoo/kamailio/db/kazoo.db ]; then KazooDB -init /etc/kazoo/kamailio/kazoodb.sql fi @@ -50,12 +50,12 @@ prepare() { } ram_disk_enabled() { - grep -e "^\s*enable_ram_disk\s*=\s*true" /etc/kazoo/kamailio/local.cfg &> /dev/null + grep -e "enable_ram_disk = true" /etc/kazoo/kamailio/local.cfg &> /dev/null return $? } mount_point_exists() { - mount | grep /etc/kazoo/kamailio/db &> /dev/null + mount | grep /etc/kazoo/kamailio/db &> /dev/null return $? } @@ -72,10 +72,10 @@ start() { exec "$@" else set -- ${BIN_FILE} -f ${CFG_FILE} -m ${SHM_MEMORY} -M ${PKG_MEMORY} -u ${USER} -g ${GROUP} ${EXTRA_OPTIONS} "$@" - runuser -s /bin/bash ${USER} -c "$*" + runuser -s /bin/bash ${USER} -c "$*" fi RETVAL=$? - + if [ ${RETVAL} -ne 0 ]; then echo "Failed to start Kamailio!" RETVAL=1 @@ -85,7 +85,7 @@ start() { stop() { killall ${BIN_FILE} RETVAL=$? - if mount_point_exists; then + if mount_point_exists; then if [ -f /etc/kazoo/kamailio/kazoo.db ]; then mv /etc/kazoo/kamailio/db /etc/kazoo/kamailio/db-backup fi @@ -101,14 +101,14 @@ reset-restart() { cd /etc/kazoo/kamailio/dbtext/ stop - head -n1 active_watchers > active_watchers.tmp - mv -f active_watchers.tmp active_watchers + head -n1 active_watchers > active_watchers.tmp + mv -f active_watchers.tmp active_watchers head -n1 watchers > watchers.tmp - mv -f watchers.tmp watchers + mv -f watchers.tmp watchers - head -n1 presentity > presentity.tmp - mv -f presentity.tmp presentity + head -n1 presentity > presentity.tmp + mv -f presentity.tmp presentity chown kamailio:daemon *