diff options
| author | Oskar Nyberg <oskar@mullvad.net> | 2023-08-30 17:40:46 +0200 |
|---|---|---|
| committer | Oskar Nyberg <oskar@mullvad.net> | 2023-08-30 17:40:46 +0200 |
| commit | 9da8e2c891cf371b30438a28a2114d509e87f101 (patch) | |
| tree | eae791e27e9b523ab6ef9f2a4f1cebaad474e49c | |
| parent | ead6ae66fe565cb01bf4b2c563e79da2ee252351 (diff) | |
| parent | ce047efa923f98791c9b36345c199d2f6bc9dc16 (diff) | |
| download | mullvadvpn-9da8e2c891cf371b30438a28a2114d509e87f101.tar.xz mullvadvpn-9da8e2c891cf371b30438a28a2114d509e87f101.zip | |
Merge branch 'clear-gpu-cache-des-315'
| -rw-r--r-- | dist-assets/linux/after-remove.sh | 60 |
1 files changed, 41 insertions, 19 deletions
diff --git a/dist-assets/linux/after-remove.sh b/dist-assets/linux/after-remove.sh index 8dfe875a46..2b3a93e5f2 100644 --- a/dist-assets/linux/after-remove.sh +++ b/dist-assets/linux/after-remove.sh @@ -8,32 +8,50 @@ function remove_logs_and_cache { echo "Failed to remove mullvad-vpn cache" } +function get_home_dirs { + if [[ -f "/etc/passwd" ]] && command -v cut > /dev/null; then + cut -d: -f6 /etc/passwd + fi +} + +function clear_gpu_cache { + local home_dirs + home_dirs=$(get_home_dirs) + + for home_dir in $home_dirs; do + local gpu_cache_dir="$home_dir/.config/Mullvad VPN/GPUCache" + if [[ -d "$gpu_cache_dir" ]]; then + echo "Clearing GPU cache in $gpu_cache_dir" + rm -r --interactive=never "$gpu_cache_dir" || \ + echo "Failed to clear GPU cache" + fi + done +} + function remove_config { rm -r --interactive=never /etc/mullvad-vpn || \ echo "Failed to remove mullvad-vpn config" # Remove app settings and auto-launcher for all users. This doesn't respect XDG_CONFIG_HOME due # to the complexity required. - if [[ -f "/etc/passwd" ]] && command -v cut > /dev/null; then - local home_dirs - home_dirs=$(cut -d: -f6 /etc/passwd) - for home_dir in $home_dirs; do - local mullvad_dir="$home_dir/.config/Mullvad VPN" - if [[ -d "$mullvad_dir" ]]; then - echo "Removing mullvad-vpn app settings from $mullvad_dir" - rm -r --interactive=never "$mullvad_dir" || \ - echo "Failed to remove mullvad-vpn app settings" - fi + local home_dirs + home_dirs=$(get_home_dirs) + for home_dir in $home_dirs; do + local mullvad_dir="$home_dir/.config/Mullvad VPN" + if [[ -d "$mullvad_dir" ]]; then + echo "Removing mullvad-vpn app settings from $mullvad_dir" + rm -r --interactive=never "$mullvad_dir" || \ + echo "Failed to remove mullvad-vpn app settings" + fi - local autostart_path="$home_dir/.config/autostart/mullvad-vpn.desktop" - # mullvad-vpn.desktop can be both a file or a symlink. - if [[ -f "$autostart_path" || -L "$autostart_path" ]]; then - echo "Removing mullvad-vpn app autostart file $autostart_path" - rm --interactive=never "$autostart_path" || \ - echo "Failed to remove mullvad-vpn autostart file" - fi - done - fi + local autostart_path="$home_dir/.config/autostart/mullvad-vpn.desktop" + # mullvad-vpn.desktop can be both a file or a symlink. + if [[ -f "$autostart_path" || -L "$autostart_path" ]]; then + echo "Removing mullvad-vpn app autostart file $autostart_path" + rm --interactive=never "$autostart_path" || \ + echo "Failed to remove mullvad-vpn autostart file" + fi + done } # checking what kind of an action is taking place @@ -52,3 +70,7 @@ case $@ in remove_config ;; esac + +# Different electron versions can have incompatible GPU caches. Clearing it on upgrades makes sure +# the same cache is not used across versions. +clear_gpu_cache |
