Skip to content

Commit

Permalink
Makefile: Add mxqdctl-hostconfig.sh to 'fix' target
Browse files Browse the repository at this point in the history
  • Loading branch information
mariux committed Jan 26, 2015
1 parent c936ba0 commit 89f02a0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ clean:

.PHONY: fix
fix:
@for i in *.c *.h Makefile mysql/create_tables ; do \
@for i in *.c *.h Makefile mysql/create_tables mxqdctl-hostconfig.sh ; do \
if grep -q -m 1 -E '\s+$$' $$i ; then \
echo "FIX $$i" ; \
sed -i $$i -e 's/\s*$$//g' ; \
Expand Down
16 changes: 8 additions & 8 deletions mxqdctl-hostconfig.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,34 @@ pidfilebase=/dev/shm/mxqdctl-hostconfig

shopt -s nullglob

function start_all_hostconfig()
function start_all_hostconfig()
{
while read -a line ; do
while read -a line ; do
host=${line[0]}
var=${line[1]}

unset 'line[0]'
unset 'line[1]'


if [ "${var}" != "mxqd" ] ; then
continue
fi

if [ "${host}" != "${shorthost}" ] ; then
if [ "${host}" != "${shorthost}" ] ; then
continue
fi

args=(${defaultargs[@]} --pid-file "${pidfilebase}${started}.pid" ${line[@]})

echo "executing ${mxqd} ${args[@]}"

${mxqd} ${args[@]}

started+=1
done < ${hostconfig}

if [ ${started} -lt 1 ] ; then
if [ ${started} -lt 1 ] ; then
echo >&2 "host '${shorthost}' is not configured for mxqd in '${hostconfig}'."
exit 1
fi
Expand Down

0 comments on commit 89f02a0

Please sign in to comment.