diff --git a/start-keepass-flatp b/keepassctl similarity index 74% rename from start-keepass-flatp rename to keepassctl index 9c89493..086f8e0 100755 --- a/start-keepass-flatp +++ b/keepassctl @@ -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 } -start_keepass +test -e "$fifo" || mkfifo "$fifo" +while true; do + read l < "$fifo" + case "$l" in + start-keepass) + start_keepass + ;; + done) + exit 0 + ;; + esac +done +