Commit 2561206e authored by Vitaly Lipatov's avatar Vitaly Lipatov

gateway: preserve CLI subcommand failures

parent 46f8434c
...@@ -24,13 +24,11 @@ if [ "$command" = "list" ] ; then ...@@ -24,13 +24,11 @@ if [ "$command" = "list" ] ; then
fi fi
if [ "$command" = "unban" ] ; then if [ "$command" = "unban" ] ; then
/usr/share/eterban/unban.py $1 exec /usr/share/eterban/unban.py "$1"
exit
fi fi
if [ "$command" = "ban" ] ; then if [ "$command" = "ban" ] ; then
/usr/share/eterban/ban.py $1 "blocked with eterban manually" exec /usr/share/eterban/ban.py "$1" "blocked with eterban manually"
exit
fi fi
if [ "$command" = "check" ] ; then if [ "$command" = "check" ] ; then
...@@ -84,33 +82,28 @@ if [ "$command" = "clear" ] ; then ...@@ -84,33 +82,28 @@ if [ "$command" = "clear" ] ; then
echo "Usage: eterban clear --force" >&2 echo "Usage: eterban clear --force" >&2
exit 2 exit 2
fi fi
/usr/share/eterban/autoban_cli.py clear exec /usr/share/eterban/autoban_cli.py clear
exit
fi fi
if [ "$command" = "reload-whitelist" ] ; then if [ "$command" = "reload-whitelist" ] ; then
systemctl kill --signal=HUP eterban.service systemctl kill --signal=HUP eterban.service
exit exit $?
fi fi
if [ "$command" = "info" ] ; then if [ "$command" = "info" ] ; then
/usr/share/eterban/autoban_cli.py info $1 exec /usr/share/eterban/autoban_cli.py info "$1"
exit
fi fi
if [ "$command" = "reset" ] ; then if [ "$command" = "reset" ] ; then
/usr/share/eterban/autoban_cli.py reset $1 exec /usr/share/eterban/autoban_cli.py reset "$1"
exit
fi fi
if [ "$command" = "pending" ] ; then if [ "$command" = "pending" ] ; then
/usr/share/eterban/autoban_cli.py pending exec /usr/share/eterban/autoban_cli.py pending
exit
fi fi
if [ "$command" = "permanent" ] ; then if [ "$command" = "permanent" ] ; then
/usr/share/eterban/autoban_cli.py permanent exec /usr/share/eterban/autoban_cli.py permanent
exit
fi fi
cat <<EOF cat <<EOF
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment