You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
rwxrob-dot/scripts/checkurls

27 lines
551 B
Bash

#!/usr/bin/env bash
declare target="$1"
declare red=$'\033[38;2;255;0;0m'
declare grey=$'\033[38;2;100;100;100m'
declare green=$'\033[38;2;0;255;0m'
declare x=$'\033[0m'
if [[ -z "$(which muffet)" ]]; then
echo "${red}Requires ${grey}https://github.com/raviqqe/muffet ${red}be installed.${x}"
exit 1
fi
if [[ -z "$target" ]]; then
echo "usage: checkurls <pageurl>"
exit 1
fi
if [[ ${1:0:4} != http ]]; then
target="http://$1"
fi
muffet --one-page-only "$target"
if [[ $? -eq 0 ]];then
echo "${green}No Broken URLs detected.${x}"
fi