forked from techfutures/docker-opendcim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstartup.sh
36 lines (28 loc) · 814 Bytes
/
startup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
set -e
#in case Volume are empty
if [ "$(ls -A /var/lib/mysql)" ]; then
echo "mysql folder with data"
else
cp -Rp /var/backup/mysql/. /var/lib/mysql/
chown mysql:mysql /var/lib/mysql
fi
if [ "$(ls -A /var/www/dcim/pictures)" ]; then
echo "pictures folder with data"
else
cp -Rp /var/backup/pictures/. /var/www/dcim/pictures/
chown www-data:www-data /var/www/dcim/pictures
fi
if [ "$(ls -A /var/www/dcim/drawings)" ]; then
echo "drawings folder with data"
else
cp -Rp /var/backup/drawings/. /var/www/dcim/drawings/
chown www-data:www-data /var/www/dcim/drawings
fi
if [ -f /etc/configured ]; then
echo 'already configured'
else
#needed to fix problem with ubuntu ... and cron
update-locale
date > /etc/configured
fi