discord.sh now displays to console as well by default, and a lot of cleanup

This commit is contained in:
2025-05-16 13:12:29 -04:00
parent b45bd31954
commit be02666464
22 changed files with 171 additions and 351 deletions
+5 -5
View File
@@ -1,14 +1,14 @@
#!/usr/bin/env bash
# determine if show all or not, default to not
all=""
if [[ "$1" == "-a" ]] || [[ "$1" == "--all" ]]; then
all="--all"
all=''
if [[ "$1" == '-a' ]] || [[ "$1" == '--all' ]]; then
all='--all'
fi
if [[ -n `groups | grep 'docker'` ]]; then
if [[ -n $(groups | grep 'docker') ]]; then
docker ps $all --format='table {{.Names}}\t{{.Status}}' | grep -v 'NAMES' | sort
elif [[ -n `groups | grep 'sudo'` ]]; then
elif [[ -n $(groups | grep 'sudo') ]]; then
sudo docker ps $all --format='table {{.Names}}\t{{.Status}}' | grep -v 'NAMES' | sort
else
echo 'User lacks docker permission'