mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-05-22 08:41:50 +02:00
Binance trading bot
This commit is contained in:
16
binance-trading-bot/rootfs/entrypoint.sh
Normal file
16
binance-trading-bot/rootfs/entrypoint.sh
Normal file
@@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
echo "Starting..."
|
||||
|
||||
####################
|
||||
# Starting scripts #
|
||||
####################
|
||||
|
||||
for SCRIPTS in /etc/cont-init.d/*; do
|
||||
[ -e "$SCRIPTS" ] || continue
|
||||
echo "$SCRIPTS: executing"
|
||||
chown "$(id -u)":"$(id -g)" "$SCRIPTS"
|
||||
chmod a+x "$SCRIPTS"
|
||||
# Change shebang if no s6 supervision
|
||||
sed -i 's|/usr/bin/with-contenv bashio|/usr/bin/env bashio|g' "$SCRIPTS"
|
||||
/."$SCRIPTS" || echo "$SCRIPTS: exiting $?"
|
||||
done
|
||||
16
binance-trading-bot/rootfs/etc/cont-init.d/20-folders.sh
Normal file
16
binance-trading-bot/rootfs/etc/cont-init.d/20-folders.sh
Normal file
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# shellcheck shell=bash
|
||||
|
||||
if [ -d /config/binance-trading-bot ]; then
|
||||
echo "Moving to new location /config/addons_config/binance-trading-bot"
|
||||
mkdir -p /config/addons_config/binance-trading-bot
|
||||
chmod 777 /config/addons_config/binance-trading-bot
|
||||
mv /config/binance-trading-bot/* /config/addons_config/binance-trading-bot/
|
||||
rm -r /config/binance-trading-bot
|
||||
fi
|
||||
|
||||
if [ ! -d /config/addons_config/binance-trading-bot ]; then
|
||||
echo "Creating /config/addons_config/binance-trading-bot"
|
||||
mkdir -p /config/addons_config/binance-trading-bot
|
||||
chmod 777 /config/addons_config/binance-trading-bot
|
||||
fi
|
||||
29
binance-trading-bot/rootfs/etc/cont-init.d/99-run.sh
Normal file
29
binance-trading-bot/rootfs/etc/cont-init.d/99-run.sh
Normal file
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env bashio
|
||||
# shellcheck shell=bash
|
||||
|
||||
##############
|
||||
# Export env #
|
||||
##############
|
||||
|
||||
##################
|
||||
# Starting redis #
|
||||
##################
|
||||
exec redis-server & bashio::log.info "Starting redis"
|
||||
|
||||
####################
|
||||
# Starting mongodb #
|
||||
####################
|
||||
mkdir -p /data/db
|
||||
exec mongod --bind_ip 127.0.0.1 & bashio::log.info "Starting mongod"
|
||||
|
||||
################
|
||||
# Starting app #
|
||||
################
|
||||
cd /srv || true
|
||||
npm start docker-entrypoint.sh & bashio::log.info "Starting binance bot"
|
||||
|
||||
#########################
|
||||
# Starting Trading View #
|
||||
#########################
|
||||
bashio::log.info "Starting trading view"
|
||||
python main.py
|
||||
Reference in New Issue
Block a user