| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 | 
							- #!/bin/bash
 - #shellcheck disable=SC1090
 - 
 - . "$(sfpath)" || exit 3
 - 
 - shellfu import pretty
 - shellfu import saturnin
 - 
 - usage() {
 -     mkusage "$@" "[options]" \
 -         -- \
 -             "Print current session id and exit with 0 or 1 if there is no"   \
 -             "active session."                                                \
 -         -o                                                                   \
 -             "-d DIR     Set JAT workdir to DIR.  This is where state data"   \
 -             "           is kept.  Default: /var/tmp/jat."
 - }
 - 
 - sessid() {
 -     #
 -     # Show session id or exit with 1
 -     #
 -     local sess="$SDir/session"
 -     debug -v sess
 -     test -f "$sess" || return 1
 -     test -s "$sess" || return 1
 -     grep . "$sess"  || return 1
 -     return 0
 - }
 - 
 - main() {
 -     local SDir=$JAT__DIR
 -     while true; do case $1 in
 -         -d) SDir=$2;   shift 2 || usage -w "missing SDIR" ;;
 -         -*) usage ;;
 -         *)  break ;;
 -     esac done
 -     test -n "$SDir" && SDir=$(saturnin__conf -j -1 jattool.sdir)
 -     test -n "$SDir" || SDir=/var/tmp/jat
 -     debug -v SDir
 -     sessid
 - }
 - 
 - main "$@"
 
 
  |