我正在尝试检查我的计算机是否已通过 VPN (NORDVPN) 连接
我的 bash 脚本如下:
STATUS = "$(nordvpn status | head -n 1)"
printf "STATUS %s\n" "$STATUS"
if [[ $STATUS == "Status: Disconnected" ]]
then
echo "Disconnected from VPN..."
nordvpn connect Salt_Lake_City
fi
我得到以下输出:
STATUS: command not found
STATUS
提前致谢
我会做什么:
status="$(nordvpn status | head -n 1)"
printf "status %s\n" "$status"
if [[ $status == "Status: Disconnected" ]]
then
echo "Disconnected from VPN..."
nordvpn connect Salt_Lake_City
fi