taler-mdb

GNU Taler Extensions and Integrations
Log | Files | Refs | Submodules | README | LICENSE

taler-mdb-show.sh (1588B)


      1 #!/bin/bash
      2 #
      3 # This file is part of TALER
      4 # Copyright (C) 2023, 2024 Taler Systems SA
      5 #
      6 # TALER is free software; you can redistribute it and/or modify
      7 # it under the terms of the GNU General Public License as
      8 # published by the Free Software Foundation; either version 3, or
      9 # (at your option) any later version.
     10 #
     11 # TALER is distributed in the hope that it will be useful, but
     12 # WITHOUT ANY WARRANTY; without even the implied warranty of
     13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     14 # GNU General Public License for more details.
     15 #
     16 # You should have received a copy of the GNU General Public
     17 # License along with TALER; see the file COPYING.  If not, see
     18 # <http://www.gnu.org/licenses/>
     19 #
     20 # Author: Christian Grothoff
     21 #
     22 set -eu
     23 
     24 function cleanup()
     25 {
     26     killall fbi
     27     taler-mdb-display -c "$CONF" -i
     28     exit 0
     29 }
     30 
     31 trap cleanup EXIT
     32 
     33 CONF="$HOME/.config/taler.conf"
     34 
     35 # Parse command-line options
     36 while getopts ':c:h' OPTION; do
     37     case "$OPTION" in
     38         c)
     39             CONF="$OPTARG"
     40             ;;
     41         h)
     42             echo 'Supported options:'
     43             # shellcheck disable=SC2016
     44             echo '  -c $CONF     -- set configuration'
     45             ;;
     46         ?)
     47             exit_fail "Unrecognized command line option"
     48             ;;
     49     esac
     50 done
     51 shift $((OPTIND - 1))
     52 
     53 taler-mdb-display -c "$CONF"
     54 
     55 FBDEV=$(taler-config -c "$CONF" -s taler-mdb -o FRAMEBUFFER_DEVICE)
     56 
     57 DATA_HOME=$(taler-config -c "$CONF" -s paths -o DATADIR -f)
     58 
     59 fbi -d "$FBDEV" -a -m "768x576-75" -vt 2 -nocomments -noverbose "${DATA_HOME}mdb/$1.png"
     60 
     61 while true
     62 do
     63     sleep 10
     64 done