#!/bin/bash # Copyright (c) 2024 Rodrigo Arias Mallo # SPDX-License-Identifier: GPL-3.0-or-later IFS= read -d '>' auth # Ignore auth IFS= read -d '>' cmd set -e # Stop on first error add_bookmark() { printf "\n"; IFS= read -d '>' cmd printf "\n"; IFS= read -d '>' cmd printf "\n"; IFS= read -d '>' cmd case "$cmd" in "\n" exit } case "$cmd" in "&2; exit;; esac printf "\n" printf "Content-type: text/html\r\n\r\n" printf "\n\n\n" printf "Bookmarks\n" printf "\n" printf "\n" ffsclient bookmarks list --format netscape |\ sed 's/
/
    /g;s/
    /
  • /g;s_
__g;s___g' |\ awk '/^/ { p=1; next } p { print } { next }' printf "</body>\n"