Skip to content
Bash scripts and tools
Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples
lib
scripts
.editorconfig
.gitignore
LICENSE
README.md
aliases.sh
main.sh

README.md

Twitter LinkedIn

Bash ToolKit

Bash scripts and tools

Usages

In your scripts

To use this toolkit in your own bash scripts just start your script with the following lines :

# Load framework
readonly BIN="$(dirname "$0")"
source ${BIN}/../main.sh

Replace the path to the main.sh according to your installation.

Then you can load the modules you want with the module command :

module colors
module logs
module docker

In Monit's configuration file for docker

You can use this Toolkit to monitor docker's container with Monit.

Here is a sample config you can use for monitoring a container named portainer :

check program docker_portainer with path <path_to_toolkit>/scripts/docker_monit.sh -s portainer
      if status != 0 then alert
      start program "<path_to_toolkit>/scripts/docker_monit.sh -s portainer start"
      stop program "<path_to_toolkit>/scripts/docker_monit.sh -s portainer stop"

Don't forget to replace <path_to_toolkit> with the install directory of this toolkit.

Modules

colors

This module is used by other modules, it define some ANSI constants to use colors in your script.

logs

This module provide a list of usefull methods to display fancy log during the execution of your scripts.

docker

This module provide a list of function to manipulates docker container, with secure dependencies, and with fancy log messages.

Resources

Makefile

Screen

Misc

Bash Framework

You can’t perform that action at this time.