summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Gonzalez <roger@rogs.me>2023-01-15 20:38:36 -0300
committerRoger Gonzalez <roger@rogs.me>2023-01-15 20:38:36 -0300
commit3e193e26216c5aac34965baac61b44487b2ca561 (patch)
tree53aeb21f9ed9d68a8de1f84a2cb33bc7d8097afc
parentb5594702f82d09f953b233bc9df89222e651e038 (diff)
Improved yams error messages
-rwxr-xr-xyams15
1 files changed, 11 insertions, 4 deletions
diff --git a/yams b/yams
index f6cad96..e8a0035 100755
--- a/yams
+++ b/yams
@@ -18,6 +18,15 @@ help() {
echo "check-vpn checks if the VPN is working as expected"
}
+send_success_message() {
+ echo -e $(printf "\e[32m$1\e[0m")
+}
+
+send_error_message() {
+ echo -e $(printf "\e[31m$1\e[0m")
+ exit 255
+}
+
if [ $option == "--help" ]; then
help
exit 0
@@ -50,11 +59,9 @@ if [ $option == "check-vpn" ]; then
echo "$your_ip"
echo
if [ $qbittorrent_ip == $your_ip ]; then
- echo "Your IPs are the same! qBittorrent is NOT working!"
- exit 255
+ send_error_message "Your IPs are the same! qBittorrent is NOT working! ⚠️"
else
- echo "Your IPs are different. qBittorrent is working as expected!"
- exit 0
+ send_success_message "Your IPs are different. qBittorrent is working as expected! ✅ "
fi
fi