Scripts used in the Hassbian image.
HOME | SUITES | HASSBIAN-CONFIG (CLI) | CONTRIBUTE |
SUITES | FUNCTIONS |
So you want to contribute a suite to our collection, AWSEOME!
Here you will find some info to help you along the way.
To get inspiration you can have a look at the “template suite”
When creating a new suite it is a good idea to reuse the template suite.
files
sub-directory under your suite.Example:
From ‘/package/opt/hassbian/suites/template’
files/template.service
install
manifest
remove
upgrade
Each suite has a manifest file with information about the suite. This file needs to be valid JSON.
The name of the suite.
Your GitHuub username and link you your GitHub user profile.
A short description of what the suite does.
A longer description of what the suite does.
A bool to indicate that this is fully unattended.
A bool to indicate that this is is blocked on some distros.
Which distro that has the block.
A message to the user if it’s blocked.
All suites must validate that the suite action completed. This validation should be at the end of the action files.
Example:
validation=$(hassbian.suite.verify.service template.service)
if [ "$validation" == "0" ]; then
hassbian.suite.helper.action.success
else
hassbian.suite.helper.action.failed
return 1
fi
return 0
If your script require user inputs, they should be at the top of the function. And if possible have an option to use --accept
(-Y
) flag, to set default values and omit the input. Example:
if [ "$HASSBIAN_RUNTIME_ACCEPT" = true ]; then
username='pi'
password='raspberry'
else
hassbian.input.info "Please take the time to setup your account"
username=$(hassbian.input.text "Username:")
password=$(hassbian.input.text "Password:")
if [ "$username" == "0" ]; then
username='pi'
fi
if [ "$password" == "0" ]; then
password='raspberry'
fi
fi