mirror of
https://codeberg.org/hyperreal/bin
synced 2024-11-25 18:33:42 +01:00
19 lines
436 B
Plaintext
19 lines
436 B
Plaintext
|
#!/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
|
||
|
|