#! /bin/sh
# shepherd (Bourne shell script) -- Runs the Shepherd program using Python 2 or 3
#
# Which Python is used mainly depends on which one Ansible is available for.
# This is mainly needed for running on Debian when the Ansible package is installed.

python3 -m shepherd "$@"
exit_code=$?
# If Ansible isn't available as Python 3 modules, fall back to Python 2.
# (It used Python 2 modules until v2.7.5+dfsg-2 of the package.)
if [ $exit_code -eq 98 ] ; then
  python -m shepherd "$@"
fi
