Files
cloudron-box/scripts/checkInstall
T
Girish Ramakrishnan 125e60f125 Do not generate new password for addons on each update
They need to be generated only on infra upgrade. But start.sh was
generating it all the time and hence the existing addon containers
and the root passwords is going out of sync

Fixes #352
2015-04-24 16:14:34 -07:00

58 lines
1.7 KiB
Bash
Executable File

#!/bin/bash
set -eu
readonly SOURCE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
# reset sudo timestamp to avoid wrong success
sudo -k || sudo --reset-timestamp
# checks if all scripts are sudo access
scripts=("${SOURCE_DIR}/src/scripts/rmappdir.sh" \
"${SOURCE_DIR}/src/scripts/createappdir.sh" \
"${SOURCE_DIR}/src/scripts/reloadnginx.sh" \
"${SOURCE_DIR}/src/scripts/backupbox.sh" \
"${SOURCE_DIR}/src/scripts/backupapp.sh" \
"${SOURCE_DIR}/src/scripts/restoreapp.sh" \
"${SOURCE_DIR}/src/scripts/reboot.sh" \
"${SOURCE_DIR}/src/scripts/reloadcollectd.sh")
for script in "${scripts[@]}"; do
if [[ $(sudo -n "${script}" --check 2>/dev/null) != "OK" ]]; then
echo ""
echo "${script} does not have sudo access."
echo "You have to add the lines below to /etc/sudoers.d/yellowtent."
echo ""
echo 'Defaults!${script} env_keep="HOME NODE_ENV"'
echo "${USER} ALL=(ALL) NOPASSWD: ${script}"
echo ""
exit 1
fi
done
if ! docker inspect girish/test:0.1.0 >/dev/null 2>/dev/null; then
echo "docker pull girish/test:0.1.0 for tests to run"
exit 1
fi
if ! docker inspect girish/redis:0.1.0 >/dev/null 2>/dev/null; then
echo "docker pull girish/redis:0.1.0 for tests to run"
exit 1
fi
if ! docker inspect girish/mysql:0.2.0 >/dev/null 2>/dev/null; then
echo "docker pull girish/mysql:0.2.0 for tests to run"
exit 1
fi
if ! docker inspect girish/postgresql:0.2.0 >/dev/null 2>/dev/null; then
echo "docker pull girish/postgresql:0.2.0 for tests to run"
exit 1
fi
if ! docker inspect girish/mongodb:0.2.0 >/dev/null 2>/dev/null; then
echo "docker pull girish/mongodb:0.2.0 for tests to run"
exit 1
fi