Skip to content

Commit

Permalink
XDG cache -> XDG state
Browse files Browse the repository at this point in the history
  • Loading branch information
HenrikBengtsson committed May 17, 2024
1 parent 312d188 commit 8d510f6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ Useful resources:
* UCSF Managing Your Passwords:
- https://it.ucsf.edu/services/managing-your-passwords
Version: 5.7.0-9031
Version: 5.7.0-9032
Copyright: Henrik Bengtsson (2016-2024)
License: GPL (>= 2.1) [https://www.gnu.org/licenses/gpl.html]
Source: https://github.com/HenrikBengtsson/ucsf-vpn
Expand Down
14 changes: 7 additions & 7 deletions bin/ucsf-vpn
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
### * UCSF Managing Your Passwords:
### - https://it.ucsf.edu/services/managing-your-passwords
###
### Version: 5.7.0-9031
### Version: 5.7.0-9032
### Copyright: Henrik Bengtsson (2016-2024)
### License: GPL (>= 2.1) [https://www.gnu.org/licenses/gpl.html]
### Source: https://github.com/HenrikBengtsson/ucsf-vpn
Expand Down Expand Up @@ -1555,10 +1555,10 @@ function openconnect_stop() {
# -------------------------------------------------------------------------
# XDG config utility functions
# -------------------------------------------------------------------------
function xdg_cache_path() {
function xdg_state_path() {
local path

path=${XDG_CACHE_HOME:-$HOME/.cache}/ucsf-vpn
path=${XDG_STATE_HOME:-$HOME/.local/state}/ucsf-vpn
if [ ! -d "$path" ]; then
mkdir -p "$path"
fi
Expand All @@ -1578,7 +1578,7 @@ function xdg_config_path() {

function make_pii_file() {
pii_cleanup
mktemp --dry-run --tmpdir="$(xdg_cache_path)" --suffix=-ipinfo.json
mktemp --dry-run --tmpdir="$(xdg_state_path)" --suffix=-ipinfo.json
}

function pii_cleanup() {
Expand Down Expand Up @@ -1660,9 +1660,9 @@ function flavor_home() {
# -------------------------------------------------------------------------
# MAIN
# -------------------------------------------------------------------------
pid_file="$(xdg_cache_path)/openconnect.pid"
ip_route_novpn_file="$(xdg_cache_path)/ip-route.novpn.out"
ip_route_vpn_file="$(xdg_cache_path)/ip-route.vpn.out"
pid_file="$(xdg_state_path)/openconnect.pid"
ip_route_novpn_file="$(xdg_state_path)/ip-route.novpn.out"
ip_route_vpn_file="$(xdg_state_path)/ip-route.vpn.out"
pii_file=$(make_pii_file)

source_envs
Expand Down
2 changes: 1 addition & 1 deletion vpnc/connect.d/ucsf-vpn-flavors.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

## Called via 'ucsf-vpn'?
if [ -n "${UCSF_VPN_VERSION}" ]; then
file="${UCSF_VPN_FLAVOR}"/connect.sh
file="${UCSF_VPN_FLAVOR}"/pre-connect.sh
if [ -f "${file}" ]; then
. "${file}"
fi
Expand Down

0 comments on commit 8d510f6

Please sign in to comment.