refactor code into collectd.js
This commit is contained in:
@@ -13,7 +13,7 @@ if [[ $# == 1 && "$1" == "--check" ]]; then
|
||||
fi
|
||||
|
||||
cmd="$1"
|
||||
appid="$2"
|
||||
metric="$2" # note that this can also be 'cloudron-backup' or appid
|
||||
|
||||
if [[ "${BOX_ENV}" == "cloudron" ]]; then
|
||||
# when restoring the cloudron with many apps, the apptasks rush in to restart
|
||||
@@ -30,10 +30,10 @@ if [[ "${BOX_ENV}" == "cloudron" ]]; then
|
||||
|
||||
# delete old stats when uninstalling an app
|
||||
if [[ "${cmd}" == "remove" ]]; then
|
||||
echo "Removing collectd stats of ${appid}"
|
||||
echo "Removing collectd stats of ${metric}"
|
||||
|
||||
for i in {1..10}; do
|
||||
if rm -rf ${HOME}/platformdata/graphite/whisper/collectd/localhost/*${appid}*; then
|
||||
if rm -rf ${HOME}/platformdata/graphite/whisper/collectd/localhost/*${metric}*; then
|
||||
break
|
||||
fi
|
||||
echo "Failed to remove collectd directory. collectd possibly generated data in the middle of removal"
|
||||
|
||||
Reference in New Issue
Block a user