mirror of
https://github.com/runcitadel/core.git
synced 2024-12-27 07:05:05 +00:00
Update Citadel CLI (#73)
* fix: show status of all containers * feat: allow restarting individual services * feat: add short form alias * fix: remove short form alias * fix: update help msg
This commit is contained in:
parent
1d06c3c33b
commit
2d5949b140
22
cli/citadel
22
cli/citadel
|
@ -56,9 +56,9 @@ if [[ "$command" = "status" ]]; then
|
|||
echo
|
||||
|
||||
if $long; then
|
||||
docker container ls --format "table {{.Names}}\t{{.Image}}\t{{.Status}}\t{{.Ports}}"
|
||||
docker container ls --all --format "table {{.Names}}\t{{.Image}}\t{{.Status}}\t{{.Ports}}"
|
||||
else
|
||||
docker container ls --format "table {{.Names}}\t{{.Status}}"
|
||||
docker container ls --all --format "table {{.Names}}\t{{.Status}}"
|
||||
fi
|
||||
|
||||
if [[ $(pgrep -f karen) ]]; then
|
||||
|
@ -140,24 +140,29 @@ if [[ "$command" = "stop" ]]; then
|
|||
exit
|
||||
fi
|
||||
|
||||
# Restart Citadel
|
||||
# Restart Citadel or individual services
|
||||
if [[ "$command" = "restart" ]]; then
|
||||
shift
|
||||
|
||||
# TODO: enable restarting services
|
||||
|
||||
# restart Docker containers
|
||||
if [ ! -z ${1+x} ]; then
|
||||
echo "Too many arguments."
|
||||
echo "Usage: \`$CLI_NAME $command\`"
|
||||
exit 1
|
||||
docker restart $@ || {
|
||||
echo "To see all installed services & apps use \`$CLI_NAME list\`"
|
||||
echo "Usage: \`$CLI_NAME $command <service>\`"
|
||||
exit 1
|
||||
}
|
||||
|
||||
exit
|
||||
fi
|
||||
|
||||
# restart Citadel
|
||||
if $(is_managed_by_systemd); then
|
||||
sudo systemctl restart $SERVICE_NAME
|
||||
else
|
||||
sudo $CITADEL_ROOT/scripts/stop
|
||||
sudo $CITADEL_ROOT/scripts/start
|
||||
fi
|
||||
|
||||
exit
|
||||
fi
|
||||
|
||||
|
@ -177,6 +182,7 @@ fi
|
|||
|
||||
# List all installed services apps
|
||||
if [[ "$command" = "list" ]]; then
|
||||
# TODO: make this a bit nicer
|
||||
echo 'karen'
|
||||
docker ps --format "{{.Names}}"
|
||||
exit
|
||||
|
|
|
@ -13,20 +13,20 @@ Flags:
|
|||
-v, --version Show version information for this CLI
|
||||
|
||||
Commands:
|
||||
status Check the status of all services
|
||||
status [options] Check the status of all services
|
||||
start Start the Citadel service
|
||||
stop Stop the Citadel service safely
|
||||
restart Restart the Citadel service
|
||||
restart [service] Restart Citadel or individual services
|
||||
reboot Reboot the system
|
||||
shutdown Shutdown the system
|
||||
update Update Citadel
|
||||
update [options] Update Citadel
|
||||
list List all installed services apps
|
||||
run <service> "<command>" Run a command inside a container
|
||||
set <command> Switch between Bitcoin & Lightning implementations
|
||||
app <command> Install, update or restart apps
|
||||
configure <service> Edit service & app configuration files
|
||||
logs <service> Show logs for an app or service
|
||||
debug View logs for troubleshooting
|
||||
logs [service] Show logs for an app or service
|
||||
debug [options] View logs for troubleshooting
|
||||
EOF
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user