check for file existence
This commit is contained in:
parent
5e42ef094d
commit
7a17ef2a80
|
|
@ -49,9 +49,18 @@ install() {
|
||||||
-P "$DATASOURCES_DEFAULT_PORT" \
|
-P "$DATASOURCES_DEFAULT_PORT" \
|
||||||
-BN -e "SHOW TABLES FROM $DATASOURCES_DEFAULT_DATABASE" \
|
-BN -e "SHOW TABLES FROM $DATASOURCES_DEFAULT_DATABASE" \
|
||||||
-p"$DATASOURCES_DEFAULT_PASSWORD" |wc -l)
|
-p"$DATASOURCES_DEFAULT_PASSWORD" |wc -l)
|
||||||
|
app_config="/var/www/passbolt/config/app.php"
|
||||||
|
|
||||||
|
if [ ! -f "$app_config" ]; then
|
||||||
|
su -c 'cp /var/www/passbolt/config/app.default.php /var/www/passbolt/config/app.php' -s /bin/sh www-data
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$PASSBOLT_GPG_SERVER_KEY_FINGERPRINT" ]; then
|
||||||
|
gpg_auto_fingerprint="$(su -c "gpg --with-fingerprint $gpg_public_key | grep fingerprint | awk '{for(i=4;i<=NF;++i)printf \$i}'" -ls /bin/sh www-data)"
|
||||||
|
export PASSBOLT_GPG_SERVER_KEY_FINGERPRINT=$gpg_auto_fingerprint
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$tables" -eq 0 ]; then
|
if [ "$tables" -eq 0 ]; then
|
||||||
su -c 'cp /var/www/passbolt/config/app.default.php /var/www/passbolt/config/app.php' -s /bin/sh www-data
|
|
||||||
su -c '/var/www/passbolt/bin/cake passbolt install --no-admin --force' -s /bin/sh www-data
|
su -c '/var/www/passbolt/bin/cake passbolt install --no-admin --force' -s /bin/sh www-data
|
||||||
else
|
else
|
||||||
echo "Enjoy! ☮"
|
echo "Enjoy! ☮"
|
||||||
|
|
@ -62,7 +71,7 @@ email_cron_job() {
|
||||||
root_crontab='/etc/crontabs/root'
|
root_crontab='/etc/crontabs/root'
|
||||||
cron_task_dir='/etc/periodic/1min'
|
cron_task_dir='/etc/periodic/1min'
|
||||||
cron_task='/etc/periodic/1min/email_queue_processing'
|
cron_task='/etc/periodic/1min/email_queue_processing'
|
||||||
process_email="/var/www/passbolt/app/Console/cake EmailQueue.sender --quiet"
|
process_email="/var/www/passbolt/bin/cake EmailQueue.sender --quiet"
|
||||||
|
|
||||||
mkdir -p $cron_task_dir
|
mkdir -p $cron_task_dir
|
||||||
echo "* * * * * run-parts $cron_task_dir" >> $root_crontab
|
echo "* * * * * run-parts $cron_task_dir" >> $root_crontab
|
||||||
|
|
@ -84,11 +93,6 @@ if [ ! -f "$ssl_key" ] && [ ! -L "$ssl_key" ] && \
|
||||||
gen_ssl_cert
|
gen_ssl_cert
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$PASSBOLT_GPG_SERVER_KEY_FINGERPRINT" ]; then
|
|
||||||
gpg_auto_fingerprint="$(su -c "gpg --with-fingerprint $gpg_public_key | grep fingerprint | awk '{for(i=4;i<=NF;++i)printf \$i}'" -ls /bin/sh www-data)"
|
|
||||||
export PASSBOLT_GPG_SERVER_KEY_FINGERPRINT=$gpg_auto_fingerprint
|
|
||||||
fi
|
|
||||||
|
|
||||||
install
|
install
|
||||||
email_cron_job
|
email_cron_job
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue