Initial commit
This commit is contained in:
commit
07e96e4d4a
1 file changed
+37
Executable
+37
@@ -0,0 +1,37 @@
|
||||
#!/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 "$@" \
|
||||
~/Nextcloud/data/Gemeinsam/keepass/LinusKeyPass.kdbx \
|
||||
< ~/.local/share/keepass &> /dev/null &
|
||||
STAT=$?
|
||||
echo "$!" > "$pidfile"
|
||||
return $STAT
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
start_keepass
|
||||
|
||||
Reference in new issue
Block a user