Files
keepassctl/start-keepass-flatp
T
2026-10-20 18:43:07 +02:00

38 lines
624 B
Bash
Executable File

#!/bin/bash
statedir="/tmp/keepassxc"
mkdir -p "$statedir"
pidfile="$statedir/pid"
keepass_running()
{
test -e "$pidfile" && {
KPID="$(<$pidfile)"
if ps -q "$KPID" >/dev/null 2>&1; then
zenity --info --text "Keepass läuft schon unter pid $KPID"
return 0
fi
rm "$pidfile"
}
return 1
}
start_keepass()
{
if ! keepass_running; then
flatpak run org.keepassxc.KeePassXC --pw-stdin --minimized "$@" \
~/Nextcloud/data/Gemeinsam/keepass/LinusKeyPass.kdbx \
< ~/.local/share/keepass &> /dev/null &
STAT=$?
echo "$!" > "$pidfile"
return $STAT
fi
return 0
}
start_keepass