#!/bin/sh

UID="$(id -u)"
if [ ! "$UID" ]; then exit 1; fi

# Create base directory for the ssh-agent socket.
GCR_BASE_DIR="/run/user/$UID/gcr"
if [ -e "$GCR_BASE_DIR" ]; then
	rm -rf "$GCR_BASE_DIR"
fi
mkdir -p "$GCR_BASE_DIR"

/usr/libexec/gcr-ssh-agent --base-dir "$GCR_BASE_DIR" $*
exit $?
