From def7813d714b565cd8d24ed048405a31cb0038ab Mon Sep 17 00:00:00 2001 From: Jeremy Lecour Date: Thu, 28 Apr 2022 18:51:32 +0200 Subject: [PATCH] Add "version" action --- CHANGELOG | 1 + minifirewall | 21 ++++++++++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 10b2975..2500a1f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -9,6 +9,7 @@ and this project **does not adhere to [Semantic Versioning](http://semver.org/sp * store and compare state between restart * colorize output if terminal supports colors * simple syslog logging +* "version" action ### Changed diff --git a/minifirewall b/minifirewall index 438c631..d6019d9 100755 --- a/minifirewall +++ b/minifirewall @@ -1033,10 +1033,21 @@ reset() { syslog_info "reset" printf "${GREEN}${BOLD}${NAME} reset${RESET}\n" } +show_version() { + cat <. + +${NAME} comes with ABSOLUTELY NO WARRANTY. +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 3 +of the License. +END +} -echo "${NAME} version ${VERSION}" source_configuration - check_unpersisted_state case "${1:-''}" in @@ -1061,8 +1072,12 @@ case "${1:-''}" in start ;; + version) + show_version + ;; + *) - echo "Usage: $0 {start|stop|restart|status|reset}" + echo "Usage: $0 {start|stop|restart|status|reset|version}" exit 1 ;; esac