ansible/roles/autofs/files/usercache.sh

14 lines
445 B
Bash

if [ $UID -gt 999 ] && [ "`/usr/bin/id -gn`" = "`/usr/bin/id -un`" ]; then
if [ -z "$XDG_RUNTIME_DIR" ]; then
if [ -d "/run/user/${UID}" ]; then
XDG_RUNTIME_DIR="/run/user/${UID}"
else
XDG_RUNTIME_DIR="$HOME"
fi
export XDG_RUNTIME_DIR
fi
export XDG_CACHE_HOME="$XDG_RUNTIME_DIR/.cache"
if [ ! -d "$XDG_CACHE_HOME" ] ; then
mkdir -m 0700 "$XDG_CACHE_HOME"
fi
fi