Add "version" action
This commit is contained in:
parent
900c789f95
commit
def7813d71
|
@ -9,6 +9,7 @@ and this project **does not adhere to [Semantic Versioning](http://semver.org/sp
|
||||||
* store and compare state between restart
|
* store and compare state between restart
|
||||||
* colorize output if terminal supports colors
|
* colorize output if terminal supports colors
|
||||||
* simple syslog logging
|
* simple syslog logging
|
||||||
|
* "version" action
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
|
|
21
minifirewall
21
minifirewall
|
@ -1033,10 +1033,21 @@ reset() {
|
||||||
syslog_info "reset"
|
syslog_info "reset"
|
||||||
printf "${GREEN}${BOLD}${NAME} reset${RESET}\n"
|
printf "${GREEN}${BOLD}${NAME} reset${RESET}\n"
|
||||||
}
|
}
|
||||||
|
show_version() {
|
||||||
|
cat <<END
|
||||||
|
${NAME} version ${VERSION}
|
||||||
|
|
||||||
|
Copyright 2007-2022 Evolix <info@evolix.fr>.
|
||||||
|
|
||||||
|
${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
|
source_configuration
|
||||||
|
|
||||||
check_unpersisted_state
|
check_unpersisted_state
|
||||||
|
|
||||||
case "${1:-''}" in
|
case "${1:-''}" in
|
||||||
|
@ -1061,8 +1072,12 @@ case "${1:-''}" in
|
||||||
start
|
start
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
version)
|
||||||
|
show_version
|
||||||
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
echo "Usage: $0 {start|stop|restart|status|reset}"
|
echo "Usage: $0 {start|stop|restart|status|reset|version}"
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
Loading…
Reference in a new issue