2016-01-25 17:54:02 -08:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
|
set -eu -o pipefail
|
|
|
|
|
|
|
|
|
|
if [[ ${EUID} -ne 0 ]]; then
|
|
|
|
|
echo "This script should be run as root." > /dev/stderr
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
readonly BOX_SRC_DIR=/home/yellowtent/box
|
|
|
|
|
|
|
|
|
|
if [[ $# == 1 && "$1" == "--check" ]]; then
|
|
|
|
|
echo "OK"
|
|
|
|
|
exit 0
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
echo "Retiring cloudron"
|
|
|
|
|
|
|
|
|
|
if [[ "${BOX_ENV}" != "cloudron" ]]; then
|
|
|
|
|
exit 0
|
|
|
|
|
fi
|
|
|
|
|
|
2016-07-05 22:04:24 -05:00
|
|
|
"${BOX_SRC_DIR}/setup/splashpage.sh" --retire-reason "$1" --retire-info "$2" --data "$3" # show splash
|
2016-01-25 17:54:02 -08:00
|
|
|
|
|
|
|
|
echo "Stopping apps"
|
|
|
|
|
systemctl stop docker # stop the apps
|
|
|
|
|
|
|
|
|
|
# do this at the end since stopping the box will kill this script as well
|
|
|
|
|
echo "Stopping Cloudron Smartserver"
|
|
|
|
|
"${BOX_SRC_DIR}/setup/stop.sh"
|