Echoes "$1: $2" to stdout in default colour with prefix (see bf-e).
Arguments
Text to output
[Optional] Script / executable name
Usage
bf-error
Echoes "$1: $2" to stdout in red with prefix (see bf-e), and returns 1. This will end execution of the calling script if you use, e.g. set -euo pipefail at the top of your scripts (recommended).
Arguments
Text to output
[Optional] Script / executable name
Usage
bf-notok
Like bf-error echoes "$1: $2" to stdout in red with prefix, but doesn't end execution of calling script.
Arguments
Text to output
[Optional] Script / executable name
Usage
bf-ok
Echoes "$1: $2" to stdout in green with prefix.
Arguments
Text to output
[Optional] Script / executable name
Usage
Helpers
bf-adduser
Create user with id $2, group with id $3, both with name $1, and no password.
Arguments
User and group name
[Optional] User ID (default: 1000)
[Optional] Group ID (default: UID)
Usage
bf-ch
Changes ownership and/or permissions of file / directory glob.
Arguments
Required (one or both):
-o X use chown to set ownership to "X"
-m Y use chmod to set permissions to "Y"
Optional:
-t f|d apply only to files ("f") or directories ("d")
-rif -t is not specified, applies action recursively to all files and directories
Usage
bf-clear
Clears contents of /tmp and apk cache.
Usage
bf-esh
Calls esh in a consistent manner.
Arguments
Path to input (template) file
Path to output (generated) file
Usage
bf-image
Display name and version of the current image, and a link to the GitHub repository.
Usage
bf-install
Run install /tmp/install and then perform cleanup (see bf-clear). Within the ecosystem this would normally be used in a Dockerfile
Usage
This is the basic structure of Dockerfiles based on the Alpine S6 image, copying overlay and then running the standard installation.
bf-rmrf
Runs rm -rf $1 safely: doing nothing if $1 is empty. This is handy if the path you are deleting is contained in a variable (it effectively stops rm -rf /!).
Arguments
Folder path / file glob to delete.
Usage
bf-rnd
Generates a string of random letters and numbers of length $1.
Arguments
[Optional] Number of characters to return
Usage
bf-test-url
Uses wget to test URL $1.
Arguments
URL to test
Usage
bf-tz
Sets the container's timezone to $1. (Installs tzdata package, changes timezone and then removes tzdata).