Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions modules/services.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,25 @@ function services {
# list all installed services
elif [ "$service_name" = "installed" ]; then
checkargn $# 2
if [ "$command" = "full" ]; then
docker ps -a
elif [ -z "$command" ]; then
if [ -z "$command" ]; then
available=($(services available))
for service in "${available[@]}"
do
if [ -d /srv/$service ]; then
echo $service
fi
done
elif [ "$command" = "full" ]; then
docker ps -a
else
echo "ERROR: unknown command option"
echo "USAGE: $BASENAME services installed <full>"
exit 1
fi
# list all running services
elif [ "$service_name" = "running" ]; then
checkargn $# 2
if [ "$command" = "full" ]; then
docker ps
elif [ -z "$command" ]; then
if [ -z "$command" ]; then
running=$(docker ps --format '{{.Names}}')
array=($running)
results=""
Expand All @@ -54,6 +56,12 @@ function services {
results+=" "
done
echo ${results} | tr ' ' '\n' | uniq | xargs
elif [ "$command" = "full" ]; then
docker ps
else
echo "ERROR: unknown command option"
echo "USAGE: $BASENAME services running <full>"
exit 1
fi
# list all ports used by services
elif [ "$service_name" = "ports" ]; then
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@treehouses/cli",
"version": "1.16.21",
"version": "1.16.22",
"remote": "2251",
"description": "Thin command-line interface for Raspberry Pi low level configuration.",
"main": "cli.sh",
Expand Down