forked from raycast/script-commands
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstatus.sh
executable file
·40 lines (35 loc) · 894 Bytes
/
status.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Mullvad Status
# @raycast.mode inline
#
# Conditional parameters:
# @raycast.refreshTime 5m
#
# Optional parameters:
# @raycast.packageName Mullvad
# @raycast.icon images/mullvad.png
#
# Documentation:
# @raycast.author Phil Salant
# @raycast.authorURL https://github.com/PSalant726
# @raycast.description Display the current status of the Mullvad VPN tunnel connection.
#
# Dependencies:
# The Mullvad CLI: https://mullvad.net/en/help/cli-command-wg/
if ! command -v mullvad &> /dev/null; then
echo "⚠️ The Mullvad CLI is not installed"
exit 1
fi
status=$(mullvad status)
success=$?
if [ $success -ne 0 ]; then
echo "⚠️ Failed to update VPN tunnel connection status"
exit 1
fi
if [[ $status == *"Disconnected"* ]]; then
echo "❌ Disconnected and unsecured"
else
echo "✅ $status"
fi