2023-07-10 21:14:23 -07:00
|
|
|
{{- if (ne .host.distro.family "windows") -}}
|
|
|
|
#!/usr/bin/env bash
|
|
|
|
# @file Disconnect from WARP
|
|
|
|
# @brief Disconnects from CloudFlare Teams / WARP
|
|
|
|
# @description
|
|
|
|
# This script detects for the presence of the `warp-cli` and the WARP connection status. If `warp-cli` is installed
|
|
|
|
# and WARP is connected, then the service is disconnected. This feature is here to ensure programs such as `volta`
|
|
|
|
# which do not support custom CA certificates can still function properly.
|
|
|
|
|
|
|
|
{{ includeTemplate "universal/profile-before" }}
|
|
|
|
{{ includeTemplate "universal/logg-before" }}
|
|
|
|
|
|
|
|
if command -v warp-cli > /dev/null; then
|
|
|
|
if warp-cli status | grep 'Connected' > /dev/null; then
|
|
|
|
logg info 'Disconnecting from CloudFlare Teams / WARP due to Volta ignoring CA specified in NPM configuration'
|
2023-08-08 13:27:50 -07:00
|
|
|
warp-cli disconnect
|
2023-07-10 21:14:23 -07:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
{{ end -}}
|