28 lines
831 B
Bash
28 lines
831 B
Bash
#! /bin/bash
|
|
|
|
# make sure the upload folder exists and is writeable by www-data
|
|
# do not make any changes to an already existing folder
|
|
|
|
if [ ! -e /var/lib/swarmops/upload ]; then
|
|
mkdir -p /var/lib/swarmops/upload
|
|
chown www-data:www-data /var/lib/swarmops/upload
|
|
chmod 777 /var/lib/swarmops/upload
|
|
fi
|
|
|
|
# make sure the web frontend (and its init routine) can write to machineKey.config
|
|
# TODO: add test here - only chown if it's the pristine, unedited file
|
|
|
|
chown www-data:www-data /etc/swarmops/machineKey.config
|
|
|
|
# make sure the web frontend (and its init) can write to database.config
|
|
|
|
chown www-data:www-data /etc/swarmops/database.config
|
|
|
|
# if we stopped Apache in preinst (1st install), restart it
|
|
|
|
if [ -e /tmp/swarmops-restart-apache.flag ]; then
|
|
/etc/init.d/apache2 start
|
|
rm /tmp/swarmops-restart-apache.flag
|
|
fi
|
|
|