# start server
start ()
{
+ checknodenameusage
+ [ "$?" -eq 0 ] && echo "\nERROR: The node '$ERLANG_NODE' is already running." && return 1
+
$EXEC_CMD "$ERL \
$NAME $ERLANG_NODE \
-noinput -detached \
# start interactive server
live ()
{
+ checknodenameusage
+ [ "$?" -eq 0 ] && echo "\nERROR: The node '$ERLANG_NODE' is already running." && return 1
+
echo "--------------------------------------------------------------------"
echo ""
echo "IMPORTANT: ejabberd is going to start in LIVE (interactive) mode."
return $status
}
+# check node name is used or not
+# $? --> 0=alreadyused 1=available
+checknodenameusage ()
+{
+ $EXEC_CMD "$ERL \
+ $NAME $ERLANG_NODE \
+ -s erlang halt | grep -c duplicate_name > /dev/null "
+}
+
case $ARGS in
' start') start;;
' debug') debug;;