Skip to content

Commit

Permalink
🌱 add PLUGIN_INFO
Browse files Browse the repository at this point in the history
- show plugin version
  • Loading branch information
tprelog committed Feb 21, 2021
1 parent f16558a commit 953b29a
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 2 deletions.
2 changes: 1 addition & 1 deletion overlay/root/.PLUGIN_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.20210220
1.20210220.1
19 changes: 19 additions & 0 deletions overlay/root/bin/plugin_info
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash

# shellcheck disable=SC1091,2154
. /etc/rc.subr && load_rc_config

## TODO - Add someting useful to PLUGIN_INFO ----
## NOTE Try not to use more than 50 characters or
## the line will wrap. -- Leading white space and
## blank lines are not rendered in the TrueNAS UI
## ----------------------------------------------
cat << PLUGIN_INFO > /root/PLUGIN_INFO
Please see the wiki for more information
- plugin version: ${plugin_version}
PLUGIN_INFO
## ----------------------------------------------

exit
3 changes: 3 additions & 0 deletions post_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ service zwavejs2mqtt start
## Start the console menu, upon login as user "root"
echo -e "\n# Start console menu after login." >> /root/.login
echo "if ( -x /root/bin/menu ) menu" >> /root/.login

## Gererate PLUGIN_INFO
/root/bin/plugin_info
5 changes: 4 additions & 1 deletion post_update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ upgrade_service() {
# shellcheck disable=SC2154
version="${plugin_version%%.*}"
if [ "${version}" == '1' ]; then
plugin_upgrade_service='YES'
true #plugin_upgrade_service='YES'
elif [ "${version}" == '2' ]; then
true
else
Expand All @@ -34,3 +34,6 @@ checkyesno plugin_enable_pkglist && install_pkglist
checkyesno plugin_upgrade_service && upgrade_service

sysrc plugin_version="$(cat /root/.PLUGIN_VERSION)"

## Gererate PLUGIN_INFO
/root/bin/plugin_info

0 comments on commit 953b29a

Please sign in to comment.