diff --git a/tootpaste.sh b/tootpaste.sh index ea02d5b..4e2d24a 100644 --- a/tootpaste.sh +++ b/tootpaste.sh @@ -118,6 +118,14 @@ statuses_remove(){ $DRY_RUN || $TOOTCTL statuses remove --days "$STATUSES_REMOVE_DAYS" } +check_command(){ + command -v "$1" > /dev/null +} + +for command in $TOOTCTL curl grep awk cut sort; do + check_command "$command" || (echo "$command not found, exiting..."; exit 1) +done + $DO_ACCOUNTS_CULL && accounts_cull $DO_MEDIA_REMOVE && media_remove $DO_STATUSES_REMOVE && statuses_remove