bin/registry_rm_repo
2024-07-21 10:34:58 -05:00

19 lines
436 B
Bash
Executable File

#!/usr/bin/env bash
# registry-rm-repo
# description: remove repository directory from registry data directory
set -eu
REPO_DIR="/mnt/registry_data/data/docker/registry/v2/repositories/"
REPO_TO_DELETE="$1"
if [ -d "${REPO_DIR}/${REPO_TO_DELETE}" ]; then
sudo rm -rf "${REPO_DIR}/${REPO_TO_DELETE}"
echo "${REPO_TO_DELETE} repo successfully deleted"
exit 0
else
echo "${REPO_TO_DELETE} repo not found"
exit 1
fi