fi
# figure out $DISPLAY when running from cron
-if [ -z "${DISPLAY:-}" ]; then
- socket="/run/user/`id -u`/X11-display"
- if [ -L "$socket" ]; then
- socket=$(readlink "$socket")
- export DISPLAY=:${socket##*/X}
- fi
-fi
+export DISPLAY="${DISPLAY:-:0}"
-if ! ip route | grep -q '^default.*wlan'; then
+if ! ip route | grep -q '^default.*wl'; then
notify-send "Backup skipped, not on WLAN"
exit 0
fi
# figure out ssh agent when running from cron
if [ -z "${SSH_AUTH_SOCK:-}" ]; then
- ssh_socket=$(ls /run/user/`id -u`/keyring-*/ssh 2>/dev/null)
+ ssh_socket=$(ls /run/user/`id -u`/keyring*/ssh 2>/dev/null)
if [ -S "$ssh_socket" ]; then
export SSH_AUTH_SOCK="$ssh_socket"
fi