23 lines
492 B
Bash
Executable File
23 lines
492 B
Bash
Executable File
#! /bin/sh
|
|
#
|
|
|
|
if [ "$(id -u)" -ne 0 ]; then
|
|
echo "must be ran as root"
|
|
exit 1
|
|
fi
|
|
|
|
volumes="certs dynamic logs root static webroot"
|
|
for volume in ${volumes}; do
|
|
mount_path="${PWD}/traefik-volumes/${volume}"
|
|
if [ "${volume}" = "webroot" ]; then
|
|
mount_path="${PWD}/${volume}-volume"
|
|
fi
|
|
if [ "${volume}" = "root" ]; then
|
|
mount_path="${PWD}/${volume}-volume"
|
|
fi
|
|
if mountpoint "${mount_path}" -q; then
|
|
echo "umounting ${mount_path}"
|
|
umount "${mount_path}"
|
|
fi
|
|
done
|