remove special rm script for redis

This commit is contained in:
Girish Ramakrishnan
2018-10-15 14:38:33 -07:00
parent 816fa94555
commit 2c60614d4b
5 changed files with 4 additions and 39 deletions

View File

@@ -25,9 +25,9 @@ if [[ "${addon}" != "postgresql" && "${addon}" != "mysql" && "${addon}" != "mong
fi
if [[ "${BOX_ENV}" == "cloudron" ]]; then
readonly addon_dir="${HOME}/platformdata/${addon}"
readonly addon_dir="${HOME}/platformdata/${addon}/${appid}"
else
readonly addon_dir="${HOME}/.cloudron_test/platformdata/${addon}"
readonly addon_dir="${HOME}/.cloudron_test/platformdata/${addon}/${appid}"
fi
rm -rf "${addon_dir}"

View File

@@ -1,31 +0,0 @@
#!/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
# this script is called from redis addon as well!
appid="$1"
if [[ "${BOX_ENV}" == "cloudron" ]]; then
readonly redis_dir="${HOME}/platformdata/redis/${appid}"
else
readonly redis_dir="${HOME}/.cloudron_test/platformdata/redis/${appid}"
fi
rm -rf "${redis_dir}"