A few updates, cleanup updated weather module.
This commit is contained in:
19
functions.sh
19
functions.sh
@@ -4,6 +4,25 @@ if [[ -z "$input" ]]; then
|
||||
input="$(mktemp .XXXXXX)"
|
||||
fi
|
||||
|
||||
# Check if required dependencies are available
|
||||
# Usage: check_dependencies "command1" "command2" ...
|
||||
# Returns 0 if all found, 1 if any missing
|
||||
check_dependencies() {
|
||||
local missing=()
|
||||
local cmd
|
||||
for cmd in "$@"; do
|
||||
if ! command -v "$cmd" &> /dev/null; then
|
||||
missing+=("$cmd")
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ ${#missing[@]} -gt 0 ]]; then
|
||||
echo "Missing dependencies: ${missing[*]}"
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
close_bot() {
|
||||
echo -en "QUIT :${quitMessage}\r\n" >> "$input"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user