mirror of
https://github.com/hackacad/bastille.git
synced 2026-01-06 04:34:19 +01:00
Feature to disable output colors
This commit is contained in:
@@ -28,7 +28,21 @@
|
||||
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
. /usr/local/share/bastille/colors.pre.sh
|
||||
. /usr/local/etc/bastille/bastille.conf
|
||||
|
||||
# Load text output colors if enabled in config
|
||||
# else reset colors variables used by bastille
|
||||
case "${bastille_colors_enable}" in
|
||||
[Yy][Ee][Ss])
|
||||
. /usr/local/share/bastille/colors.pre.sh
|
||||
;;
|
||||
*)
|
||||
COLOR_RED=
|
||||
COLOR_GREEN=
|
||||
COLOR_YELLOW=
|
||||
COLOR_RESET=
|
||||
;;
|
||||
esac
|
||||
|
||||
# Notify message on error, but do not exit
|
||||
error_notify() {
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
usage() {
|
||||
# Build an independent usage for the create command
|
||||
# If no option specified, will create a thin container by default
|
||||
echo -e "${COLOR_RED}Usage: bastille create [option(s)] name release ip [interface]${COLOR_RESET}"
|
||||
error_notify "Usage: bastille create [option(s)] name release ip [interface]"
|
||||
|
||||
cat << EOF
|
||||
Options:
|
||||
|
||||
@@ -36,7 +36,7 @@ usage() {
|
||||
# Valid compress/options for ZFS systems are raw, .gz, .tgz, .txz and .xz
|
||||
# Valid compress/options for non ZFS configured systems are .tgz and .txz
|
||||
# If no compression option specified, user must redirect standard output
|
||||
echo -e "${COLOR_RED}Usage: bastille export | option(s) | TARGET | PATH${COLOR_RESET}"
|
||||
error_notify "Usage: bastille export | option(s) | TARGET | PATH"
|
||||
|
||||
cat << EOF
|
||||
Options:
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
usage() {
|
||||
# Build an independent usage for the import command
|
||||
# If no file/extension specified, will import from standard input
|
||||
echo -e "${COLOR_RED}Usage: bastille import [option(s)] FILE${COLOR_RESET}"
|
||||
error_notify "Usage: bastille import [option(s)] FILE"
|
||||
|
||||
cat << EOF
|
||||
Options:
|
||||
|
||||
Reference in New Issue
Block a user