Mit Fifo
This commit is contained in:
1 parent
07e96e4d4a
commit
21911e0647
1 file changed
+13
-4
@@ -4,6 +4,7 @@ statedir="/tmp/keepassxc"
|
||||
mkdir -p "$statedir"
|
||||
|
||||
pidfile="$statedir/pid"
|
||||
fifo="$statedir/fifo"
|
||||
|
||||
keepass_running()
|
||||
{
|
||||
@@ -25,13 +26,21 @@ start_keepass()
|
||||
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
|
||||
}
|
||||
|
||||
test -e "$fifo" || mkfifo "$fifo"
|
||||
while true; do
|
||||
read l < "$fifo"
|
||||
case "$l" in
|
||||
start-keepass)
|
||||
start_keepass
|
||||
;;
|
||||
done)
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
|
||||
Reference in new issue
Block a user