services: separate volume clear and rm

This commit is contained in:
Girish Ramakrishnan
2025-01-12 18:08:53 +01:00
parent 665f7c849b
commit e34e479c33
5 changed files with 47 additions and 16 deletions
+22
View File
@@ -0,0 +1,22 @@
#!/bin/bash
set -eu -o pipefail
if [[ ${EUID} -ne 0 ]]; then
echo "This script should be run as root." > /dev/stderr
exit 1
fi
if [[ $# -eq 0 ]]; then
echo "No arguments supplied"
exit 1
fi
if [[ "$1" == "--check" ]]; then
echo "OK"
exit 0
fi
volume_dir="$1"
mkdir -p "${volume_dir}"