bin/registry_rm_repo

19 lines
436 B
Plaintext
Raw Normal View History

2023-02-25 02:44:30 +01:00
#!/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