-
Notifications
You must be signed in to change notification settings - Fork 6
/
install
104 lines (83 loc) · 5.02 KB
/
install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#!/bin/bash
echo ========================================================================
echo Before continuing make sure you already have the following information:
echo Exchange key, Exchange secret, Telegram bot token, Telegram chat id.
echo ========================================================================
read -p "press enter to continue"
echo Bot Name: ; read botname ; export botname
echo Stake Currency ; read stake_currency ; export stake_currency
echo Display Currency ; read display_currency ; export display_currency
echo Stake Amount ; read stake_amount ; export stake_amount
echo Max Open Trades ; read max_open_trades ; export max_open_trades
echo Exchange Name: ; read exchange_name ; export exchange_name
echo Exchange Key: ; read exchange_key ; export exchange_key
echo Exchange Secret: ; read exchange_secret ; export exchange_secret
echo Telegram Token: ; read telegram_token ; export telegram_token
echo Telegram ChatID: ; read telegram_chatid ; export telegram_chatid
echo Web UI User: ; read webuser ; export webuser
echo Web UI Pass: ; read webpass ; export webpass
echo Web UI Port: ; read webport ; export webport
##############################################################################
echo setting variables
export secretkey=$(openssl rand -hex 16)
export ipaddress=$(wget -q -O - ipinfo.io/ip)
##############################################################################
echo updating repositories
apt update > /dev/null 2>&1
echo upgrading system
apt -y upgrade > /dev/null 2>&1
echo installing prerequisites
bash <(wget --no-check-certificate -qO- https://raw.githubusercontent.com/aristosv/freqtrade/main/install_prerequisites)
echo installing freqtrade
bash <(wget --no-check-certificate -qO- https://raw.githubusercontent.com/aristosv/freqtrade/main/install_freqtrade)
echo installing configuration
wget -q https://raw.githubusercontent.com/aristosv/freqtrade/main/install_config --output-document="/usr/local/$botname/config.json"
echo installing strategy
wget -q https://raw.githubusercontent.com/aristosv/freqtrade/main/install_strategy --output-document="/usr/local/$botname/user_data/strategies/$botname.py"
echo installing service
wget -q https://raw.githubusercontent.com/aristosv/freqtrade/main/install_service --output-document="/etc/systemd/system/$botname.service"
echo installing updateFreqtrade
wget -q https://raw.githubusercontent.com/aristosv/freqtrade/main/install_updateFreqtrade --output-document="/usr/local/$botname/updateFreqtrade"
echo installing updateConfig
wget -q https://raw.githubusercontent.com/aristosv/freqtrade/main/install_updateConfig --output-document="/usr/local/$botname/updateConfig"
echo installing updateStrategy
wget -q https://raw.githubusercontent.com/aristosv/freqtrade/main/install_updateStrategy --output-document="/usr/local/$botname/updateStrategy"
echo updating configuration
sed -i "s/\$botname/$botname/g" /usr/local/$botname/config.json
sed -i "s/\$stake_currency/$stake_currency/g" /usr/local/$botname/config.json
sed -i "s/\$display_currency/$display_currency/g" /usr/local/$botname/config.json
sed -i "s/\$stake_amount/$stake_amount/g" /usr/local/$botname/config.json
sed -i "s/\$max_open_trades/$max_open_trades/g" /usr/local/$botname/config.json
sed -i "s/\$exchange_name/$exchange_name/g" /usr/local/$botname/config.json
sed -i "s/\$exchange_key/$exchange_key/g" /usr/local/$botname/config.json
sed -i "s/\$exchange_secret/$exchange_secret/g" /usr/local/$botname/config.json
sed -i "s/\$telegram_token/$telegram_token/g" /usr/local/$botname/config.json
sed -i "s/\$telegram_chatid/$telegram_chatid/g" /usr/local/$botname/config.json
sed -i "s/\$webuser/$webuser/g" /usr/local/$botname/config.json
sed -i "s/\$webpass/$webpass/g" /usr/local/$botname/config.json
sed -i "s/\$webport/$webport/g" /usr/local/$botname/config.json
sed -i "s/\$ipaddress/$ipaddress/g" /usr/local/$botname/config.json
sed -i "s/\$secretkey/$secretkey/g" /usr/local/$botname/config.json
echo updating strategy
sed -i "s/\$class/$botname/g" /usr/local/$botname/user_data/strategies/$botname.py
echo updating service
sed -i "s/\$botname/$botname/g" /etc/systemd/system/$botname.service
echo updating updateFreqtrade
chmod +x /usr/local/$botname/updateFreqtrade
sed -i "s/\$botname/$botname/g" /usr/local/$botname/updateFreqtrade
echo updating updateConfig
chmod +x /usr/local/$botname/updateConfig
sed -i "s/\$botname/$botname/g" /usr/local/$botname/updateConfig
echo updating updateStrategy
chmod +x /usr/local/$botname/updateStrategy
sed -i "s/\$botname/$botname/g" /usr/local/$botname/updateStrategy
echo enabling service
systemctl daemon-reload
systemctl enable $botname.service > /dev/null 2>&1
systemctl start $botname.service
echo =========================================================================================
echo The installation has been completed
echo Your bot should talk to you on Telegram
echo You can also access the bot at http://$ipaddress:$webport
echo You can login using username:$webuser password:$webpass
echo =========================================================================================