Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Ph3nol committed Mar 11, 2021
1 parent 0e8a5aa commit c2292b1
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
10 changes: 8 additions & 2 deletions bot
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,13 @@ if [ -f "${SCRIPT_DIRECTORY}/composer.json" ]; then

ln -s ${SCRIPT_DIRECTORY}/resources ${MANAGER_TMP_DIRECTORY}/resources

docker run -it --rm --name "freqtrade-manager-$(uuidgen)" --privileged=true \
if [ -t 1 ] ; then
DOCKER_TTY_ARGS="-it"
else
DOCKER_TTY_ARGS="-i"
fi

docker run ${DOCKER_TTY_ARGS} --rm --name "freqtrade-manager-$(uuidgen)" --privileged=true \
-e HOST_CONFIGURATION_DIRECTORY=${BOT_CONFIG_DIRECTORY} \
-e HOST_BOT_SCRIPT_PATH=${FULL_PATH} \
-v /var/run/docker.sock:/var/run/docker.sock \
Expand All @@ -50,7 +56,7 @@ if [ -f "${SCRIPT_DIRECTORY}/composer.json" ]; then
ph3nol/freqtrade-manager $*
# Staging (from Docker image)
else
docker run -it --rm --name "freqtrade-manager-$(uuidgen)" --privileged=true \
docker run ${DOCKER_TTY_ARGS} --rm --name "freqtrade-manager-$(uuidgen)" --privileged=true \
-e HOST_CONFIGURATION_DIRECTORY=${BOT_CONFIG_DIRECTORY} \
-e HOST_BOT_SCRIPT_PATH=${FULL_PATH} \
-v /var/run/docker.sock:/var/run/docker.sock \
Expand Down
4 changes: 2 additions & 2 deletions src/Manager/App/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ private function initDockerStatus(): self
if ($uptime) {
$uptime = strtolower($uptime);
$uptime = str_replace(
['up', 'less than', 'about', ' hours', ' minutes', ' seconds', ' days', ' hour', ' minute', ' second', ' day'],
['', '-', '~', 'h', 'm', 's', 'd','h', 'm', 's', 'd'],
['up', 'less than', 'about', 'one hour', 'one minute', 'one day', 'hours', ' minutes', ' seconds', ' days', ' hour', ' minute', ' second', ' day'],
['', '-', '~', '1h', '1m', '1d', 'h', 'm', 's', 'd','h', 'm', 's', 'd'],
$uptime
);
$uptime = trim($uptime);
Expand Down
2 changes: 1 addition & 1 deletion src/Manager/UI/Console/BaseCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ private function getInstanceInformations(Instance $instance): array
$instance->config['stake_currency'] ?? 'BTC'
),
sprintf('-> DRW: %f %s', $instance->config['dry_run_wallet'] ?? 0, $instance->config['stake_currency'] ?? 'BTC'),
sprintf('-> Behaviours: %s', json_encode($instance->behaviours)),
sprintf('-> Behaviours: %s', implode(', ', array_keys($instance->behaviours))),
];
}

Expand Down
2 changes: 1 addition & 1 deletion src/Manager/UI/Console/CronCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$output->writeln('This line is to add to your crontabs, in order to run periodic tasks needed by your instances and their behaviours.');
$output->writeln('');
$output->writeln(sprintf(
'<comment>*/5 * * * * /bin/bash BOT_CONFIG_DIRECTORY=%s; %s cron >> /tmp/trading-bot-manager-cron.log</comment>',
'<comment>*/5 * * * * BOT_CONFIG_DIRECTORY=%s %s cron >> /tmp/trading-bot-manager-cron.log</comment>',
HOST_MANAGER_DIRECTORY,
HOST_BOT_SCRIPT_PATH
));
Expand Down

0 comments on commit c2292b1

Please sign in to comment.