diff --git a/README.md b/README.md index 255266f..cb78e00 100644 --- a/README.md +++ b/README.md @@ -57,10 +57,16 @@ After getting source you need to download dependencies and build the source: ./rebar get-deps && ./rebar compile ``` -Then edit the `ybot.config` configuration file and you can run your Ybot copy: +Rename configration template `ybot.config.template` to `ybot.config` and edit configuration file and you can run your Ybot copy: +Start Ybot node: ``` -./start.sh +./bin/start.sh +``` + +Connect to Ybot node console: +``` +./bin/console.sh ``` Run on heroku diff --git a/bin/console.sh b/bin/console.sh new file mode 100755 index 0000000..93d0280 --- /dev/null +++ b/bin/console.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +erl -remsh ybot@$(hostname) -sname ybot_$RANDOM@$(hostname) \ No newline at end of file diff --git a/bin/start.sh b/bin/start.sh new file mode 100755 index 0000000..5b96d92 --- /dev/null +++ b/bin/start.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +SKYPE_PID=$(ps x | grep 'skype.py' | awk '/python/' | awk '{print $1}') +if [ -n "$SKYPE_PID" ]; then + kill $SKYPE_PID +fi + +if [ -f "ybot.config" ] +then + cp ybot.config ebin/ +else + echo "Unable to find ybot.config file!" + exit 1 +fi + +erl -pa deps/*/ebin plugins/*/ebin ebin \ + -boot start_sasl +P 2000000 \ + -sname ybot@$(hostname) \ + -s ybot \ + -config ybot \ + -noshell \ + -detached diff --git a/start.sh b/start.sh deleted file mode 100755 index 9fc21ca..0000000 --- a/start.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -kill $(ps x | grep 'skype.py' | awk '/python/' | awk '{print $1}') -cp ybot.config `pwd`/ebin -exec erl -pa ebin/ deps/*/ebin plugins/*/ebin -s ybot -config ybot -s reloader -boot start_sasl +P 2000000 diff --git a/ybot.config b/ybot.config.template similarity index 100% rename from ybot.config rename to ybot.config.template