diff options
author | Roger Gonzalez <roger@rogs.me> | 2023-01-15 20:38:36 -0300 |
---|---|---|
committer | Roger Gonzalez <roger@rogs.me> | 2023-01-15 20:38:36 -0300 |
commit | 3e193e26216c5aac34965baac61b44487b2ca561 (patch) | |
tree | 53aeb21f9ed9d68a8de1f84a2cb33bc7d8097afc /yams | |
parent | b5594702f82d09f953b233bc9df89222e651e038 (diff) |
Improved yams error messages
Diffstat (limited to 'yams')
-rwxr-xr-x | yams | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -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 |