Browse Source

add new whilrpool command to dojo.sh

use-env-var-docker
kenshin-samourai 5 years ago
parent
commit
814ff999ea
  1. 32
      docker/my-dojo/dojo.sh

32
docker/my-dojo/dojo.sh

@ -352,6 +352,29 @@ version() {
echo "Dojo v$DOJO_VERSION_TAG"
}
# Interact with whirlpool-cli
whirlpool() {
if [ "$WHIRLPOOL_INSTALL" == "off" ]; then
echo -e "Command not supported for your setup.\nCause: Your Dojo is not running a whirlpool client"
fi
case $1 in
apikey )
API_KEY=$( docker exec -it whirlpool cat /home/whirlpool/.whirlpool-cli/whirlpool-cli-config.properties | grep cli.apiKey= | cut -c 12-)
echo "$API_KEY"
;;
reset )
eval "docker exec -it whirlpool rm -f /home/whirlpool/.whirlpool-cli/*.json"
eval "docker exec -it whirlpool rm -f /home/whirlpool/.whirlpool-cli/whirlpool-cli-config.properties"
yamlFiles=$(select_yaml_files)
eval "docker-compose $yamlFiles restart whirlpool"
;;
* )
echo -e "Unkonwn action for the whirlpool command"
;;
esac
}
# Display logs
logs_node() {
if [ $3 -eq 0 ]; then
@ -498,6 +521,12 @@ help() {
echo " --nocache : rebuild the docker containers without reusing the cached layers."
echo " "
echo " version Display the version of dojo"
echo " "
echo " whirlpool [action] Interact with the internal whirlpool-cli mdule."
echo " "
echo " Available actions:"
echo " apikey : display the API key generated by whirlpool-cli."
echo " reset : reset the whirlpool-cli instance (delete configuration file)."
}
@ -593,4 +622,7 @@ case "$subcommand" in
version )
version
;;
whirlpool )
whirlpool "$@"
;;
esac

Loading…
Cancel
Save