25 lines
801 B
Bash
Executable File
25 lines
801 B
Bash
Executable File
#!/bin/bash
|
|
_dir="$(dirname $(realpath "${BASH_SOURCE:-$0}"))"
|
|
# echo at $@ >> ~/Desktop/ssh.log
|
|
if systemctl --user is-active ssh-agent; then
|
|
echo starting keepass unlock for $1
|
|
BASH_ENV=$HOME/ssh-agent.properties $_dir/keepassxc-unlock.sh "$@"
|
|
else
|
|
if systemctl --user list-unit-files "ssh-agent.service"; then
|
|
echo starting user ssh-agent
|
|
if systemctl --user restart ssh-agent;then
|
|
sleep 2
|
|
cat $HOME/ssh-agent.properties
|
|
echo starting keepass unlock for $1
|
|
SSH_AUTH_SOCK=$(cat $HOME/ssh-agent.properties) $_dir/keepassxc-unlock.sh "$@"
|
|
else
|
|
echo unable to start ssh-agent
|
|
fi
|
|
else
|
|
echo can not start ageent, no user unit file ssh-agent.service for user $USER
|
|
fi
|
|
fi
|
|
|
|
|
|
|