ejabberd: tabs->spaces, remove trailing whitespace

svn path=/nixos/trunk/; revision=25996
This commit is contained in:
Yury G. Kudryashov 2011-02-16 21:03:14 +00:00
parent 63bd2744b7
commit 559834437a

View File

@ -44,7 +44,7 @@ in
loadDumps = mkOption { loadDumps = mkOption {
default = []; default = [];
description = "Configuration dump that should be loaded on the first startup"; description = "Configuration dump that should be loaded on the first startup";
example = [ ./myejabberd.dump ]; example = [ ./myejabberd.dump ];
}; };
}; };
@ -62,9 +62,9 @@ in
startOn = "started network-interfaces"; startOn = "started network-interfaces";
stopOn = "stopping network-interfaces"; stopOn = "stopping network-interfaces";
environment = { environment = {
PATH = "$PATH:${pkgs.ejabberd}/sbin:${pkgs.ejabberd}/bin:${pkgs.coreutils}/bin:${pkgs.bash}/bin:${pkgs.gnused}/bin"; PATH = "$PATH:${pkgs.ejabberd}/sbin:${pkgs.ejabberd}/bin:${pkgs.coreutils}/bin:${pkgs.bash}/bin:${pkgs.gnused}/bin";
}; };
preStart = preStart =
'' ''
@ -73,31 +73,31 @@ in
if ! test -d ${cfg.spoolDir} if ! test -d ${cfg.spoolDir}
then then
initialize=1 initialize=1
cp -av ${pkgs.ejabberd}/var/lib/ejabberd /var/lib cp -av ${pkgs.ejabberd}/var/lib/ejabberd /var/lib
fi fi
if ! test -d ${cfg.confDir} if ! test -d ${cfg.confDir}
then then
mkdir -p ${cfg.confDir} mkdir -p ${cfg.confDir}
cp ${pkgs.ejabberd}/etc/ejabberd/* ${cfg.confDir} cp ${pkgs.ejabberd}/etc/ejabberd/* ${cfg.confDir}
sed -e 's|{hosts, \["localhost"\]}.|{hosts, \[${cfg.virtualHosts}\]}.|' ${pkgs.ejabberd}/etc/ejabberd/ejabberd.cfg > ${cfg.confDir}/ejabberd.cfg sed -e 's|{hosts, \["localhost"\]}.|{hosts, \[${cfg.virtualHosts}\]}.|' ${pkgs.ejabberd}/etc/ejabberd/ejabberd.cfg > ${cfg.confDir}/ejabberd.cfg
fi fi
ejabberdctl --config-dir ${cfg.confDir} --logs ${cfg.logsDir} --spool ${cfg.spoolDir} start ejabberdctl --config-dir ${cfg.confDir} --logs ${cfg.logsDir} --spool ${cfg.spoolDir} start
${if cfg.loadDumps == [] then "" else ${if cfg.loadDumps == [] then "" else
'' ''
if [ "$initialize" = "1" ] if [ "$initialize" = "1" ]
then then
# Wait until the ejabberd server is available for use # Wait until the ejabberd server is available for use
count=0 count=0
while ! ejabberdctl --config-dir ${cfg.confDir} --logs ${cfg.logsDir} --spool ${cfg.spoolDir} status while ! ejabberdctl --config-dir ${cfg.confDir} --logs ${cfg.logsDir} --spool ${cfg.spoolDir} status
do do
if [ $count -eq 30 ] if [ $count -eq 30 ]
then then
echo "Tried 30 times, giving up..." echo "Tried 30 times, giving up..."
exit 1 exit 1
fi fi
echo "Ejabberd daemon not yet started. Waiting for 1 second..." echo "Ejabberd daemon not yet started. Waiting for 1 second..."
@ -105,23 +105,23 @@ in
sleep 1 sleep 1
done done
${concatMapStrings (dump: ${concatMapStrings (dump:
'' ''
echo "Importing dump: ${dump}" echo "Importing dump: ${dump}"
if [ -f ${dump} ] if [ -f ${dump} ]
then then
ejabberdctl --config-dir ${cfg.confDir} --logs ${cfg.logsDir} --spool ${cfg.spoolDir} load ${dump} ejabberdctl --config-dir ${cfg.confDir} --logs ${cfg.logsDir} --spool ${cfg.spoolDir} load ${dump}
elif [ -d ${dump} ] elif [ -d ${dump} ]
then then
for i in ${dump}/ejabberd-dump/* for i in ${dump}/ejabberd-dump/*
do do
ejabberdctl --config-dir ${cfg.confDir} --logs ${cfg.logsDir} --spool ${cfg.spoolDir} load $i ejabberdctl --config-dir ${cfg.confDir} --logs ${cfg.logsDir} --spool ${cfg.spoolDir} load $i
done done
fi fi
'') cfg.loadDumps} '') cfg.loadDumps}
fi fi
''} ''}
''; '';
postStop = postStop =