-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathremote_fixer.sh
More file actions
executable file
·40 lines (33 loc) · 902 Bytes
/
remote_fixer.sh
File metadata and controls
executable file
·40 lines (33 loc) · 902 Bytes
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
37
38
39
40
#!/bin/bash
#@author Fred Brooker <git@gscloud.cz>
dir="$(dirname "$0")"
cd $dir
mkdir -p app ci data logs temp www/{download,upload}
[ ! -r ".env" ] && {
echo -en "Missing .env file!\n"
exit 1
}
source .env
[ -z "$ORIG" ] && {
echo "Missing ORIG definition!"
exit 1
}
[ -z "$USER" ] && {
echo "Missing USER definition!"
exit 1
}
if [ ! -z "$1" ]; then
if [ -z "${ORIG}" ]; then
echo -en "\nMissing ORIG site configuration!\n\n"
else
echo -en "\nBranch: $1 linked to ${ORIG}\n\n"
rm -rf data www/download www/upload
ln -s ${ORIG}/data data
ln -s ${ORIG}/www/download www/download
ln -s ${ORIG}/www/upload www/upload
fi
fi
chmod -R 0777 ci data logs temp www www/{download,upload}
chown -R www-data:www-data . www ci data www/{download,upload}
find www/ -type f -exec chmod 0644 {} +
rm -f data/_random_cdn_hash