✨ toolcheck
This commit is contained in:
parent
de101b21e8
commit
2137ab881b
@ -16,7 +16,7 @@ color_white=""
|
|||||||
|
|
||||||
|
|
||||||
## ONLY IF PRINTING TO A TERMINAL ##
|
## ONLY IF PRINTING TO A TERMINAL ##
|
||||||
if test -t 1; then
|
if test -t 1 && [[ -f $(which tput) ]]; then
|
||||||
# check count of supported colors
|
# check count of supported colors
|
||||||
color_count=$(TERM=${TERM:-"dumb"} tput colors)
|
color_count=$(TERM=${TERM:-"dumb"} tput colors)
|
||||||
if [[ ! -z "$color_count" && "$color_count" -ge 8 ]]; then
|
if [[ ! -z "$color_count" && "$color_count" -ge 8 ]]; then
|
||||||
|
23
lib/toolcheck
Normal file
23
lib/toolcheck
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
#
|
||||||
|
# Make sure all required tools are installed.
|
||||||
|
#
|
||||||
|
workplace_toolcheck(){
|
||||||
|
## BINARIES IN PATH ##
|
||||||
|
bin_tool_list=("grep")
|
||||||
|
for b in $bin_tool_list; do
|
||||||
|
if [[ ! -f $(which "$b") ]]; then
|
||||||
|
log_error "Missing tool '$b'"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
|
## DPKG PACKAGES ##
|
||||||
|
dpkg_tool_list=("sed iptables iproute2")
|
||||||
|
for d in $dpkg_tool_list; do
|
||||||
|
if ! dpkg -s $d 2>&1 | grep -q "Status: install ok installed"; then
|
||||||
|
log_error "Missing tool '$d'"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
2
xynat
2
xynat
@ -15,7 +15,7 @@ VERSION=$(cat ${SCRIPT_DIR}/VERSION | xargs)
|
|||||||
# load libraries
|
# load libraries
|
||||||
source "${SCRIPT_DIR}/lib/color"
|
source "${SCRIPT_DIR}/lib/color"
|
||||||
source "${SCRIPT_DIR}/lib/log"
|
source "${SCRIPT_DIR}/lib/log"
|
||||||
#source "${SCRIPT_DIR}/lib/toolcheck"
|
source "${SCRIPT_DIR}/lib/toolcheck"
|
||||||
source "${SCRIPT_DIR}/lib/sudocheck"
|
source "${SCRIPT_DIR}/lib/sudocheck"
|
||||||
|
|
||||||
# regex definitions
|
# regex definitions
|
||||||
|
Loading…
Reference in New Issue
Block a user