#!/bin/bash
# Privacy-enhanced history clearing on logout
# This script clears command history when users log out
# Generated by Algo VPN privacy role

{% if privacy_history_clearing.clear_bash_history %}
# Clear bash history
if [ -f ~/.bash_history ]; then
    > ~/.bash_history
fi

# Clear zsh history
if [ -f ~/.zsh_history ]; then
    > ~/.zsh_history
fi

# Clear current session history
history -c
history -w

# Clear less history
if [ -f ~/.lesshst ]; then
    rm -f ~/.lesshst
fi

# Clear vim history
if [ -f ~/.viminfo ]; then
    rm -f ~/.viminfo
fi
{% endif %}

{% if privacy_history_clearing.clear_system_history %}
# Clear temporary files in user directory
find ~/tmp -type f -delete 2>/dev/null || true
find ~/.cache -type f -delete 2>/dev/null || true
{% endif %}
