Skip to content

Commit cb34454

Browse files
committed
remove colors logic
1 parent 846cfc0 commit cb34454

1 file changed

Lines changed: 7 additions & 22 deletions

File tree

scripts/dappnode_uninstall.sh

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -45,21 +45,6 @@ input=$1 # Allow to call script with argument (must be Y/N)
4545
# Cross-platform Helpers #
4646
##############################
4747

48-
# Color output helper (no ANSI on macOS to avoid \e issues)
49-
color_echo() {
50-
local color="$1"; shift
51-
if $IS_LINUX; then
52-
case "$color" in
53-
green) code="\e[32m" ;;
54-
yellow) code="\e[33m" ;;
55-
*) code="" ;;
56-
esac
57-
echo -e "${code}$*\e[0m"
58-
else
59-
echo "$*"
60-
fi
61-
}
62-
6348
# Cross-platform in-place sed (macOS requires '' after -i)
6449
sed_inplace() {
6550
if $IS_MACOS; then
@@ -75,12 +60,12 @@ sed_inplace() {
7560
}
7661

7762
uninstall() {
78-
color_echo green "Uninstalling DAppNode"
63+
echo "Uninstalling DAppNode"
7964
# shellcheck disable=SC1090
8065
source "${PROFILE_FILE}" &>/dev/null
8166

8267
DAPPNODE_CONTAINERS="$(docker ps -a --format '{{.Names}}' | grep DAppNode)"
83-
color_echo green "Removing DAppNode containers: "
68+
echo "Removing DAppNode containers: "
8469
echo "${DAPPNODE_CONTAINERS}"
8570
for container in $DAPPNODE_CONTAINERS; do
8671
# Stop DAppNode container
@@ -90,27 +75,27 @@ uninstall() {
9075
done
9176

9277
DAPPNODE_IMAGES="$(docker image ls -a | grep "dappnode")"
93-
color_echo green "Removing DAppNode images: "
78+
echo "Removing DAppNode images: "
9479
echo "${DAPPNODE_IMAGES}"
9580
for image in $DAPPNODE_IMAGES; do
9681
# Remove DAppNode images
9782
docker image rm "$image" &>/dev/null
9883
done
9984

10085
DAPPNODE_VOLUMES="$(docker volume ls | grep "dappnode\|dncore")"
101-
color_echo green "Removing DAppNode volumes: "
86+
echo "Removing DAppNode volumes: "
10287
echo "${DAPPNODE_VOLUMES}"
10388
for volume in $DAPPNODE_VOLUMES; do
10489
# Remove DAppNode volumes
10590
docker volume rm "$volume" &>/dev/null
10691
done
10792

10893
# Remove dncore_network
109-
color_echo green "Removing docker dncore_network"
94+
echo "Removing docker dncore_network"
11095
docker network remove dncore_network || echo "dncore_network already removed"
11196

11297
# Remove DAppNode directory
113-
color_echo green "Removing DAppNode directory: ${DAPPNODE_DIR}"
98+
echo "Removing DAppNode directory: ${DAPPNODE_DIR}"
11499
rm -rf "${DAPPNODE_DIR}"
115100

116101
# Remove profile file references from shell config files
@@ -141,7 +126,7 @@ uninstall() {
141126
fi
142127
done
143128

144-
color_echo green "DAppNode uninstalled!"
129+
echo "DAppNode uninstalled!"
145130
}
146131

147132
if [ $# -eq 0 ]; then

0 commit comments

Comments
 (0)