blob: fc211da23d6f5c6c281212c43c5e859fc455df0c (
plain) (
blame)
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
41
42
43
44
45
|
# Here is the place to (recursively) set directory and/or file permissions.
# This is some kind of a stop gap to be sure permissions are set rightly,
# as sometimes eg. archives wield not the desired permissions.
# Also, place for some last ditch copying of files, es this is executed near
# the end of script execution.
set_directory_permissions() {
mkdir -p -m 755 "$OPENSLXDIR" 2>/dev/null
mkdir -p -m 755 "$OPENSLXDIR"/configs 2>/dev/null
chmod 755 "$OPENSLXDIR"/configs 2>/dev/null # if already there
chown -R taskmanager:taskmanager "$OPENSLXDIR"/configs
mkdir -p -m 755 "$OPENSLXDIR"/configs/modules 2>/dev/null
chmod 755 "$OPENSLXDIR"/configs/modules 2>/dev/null # if already there
chown -R taskmanager:taskmanager "$OPENSLXDIR"/configs/modules
mkdir -p -m 755 "$OPENSLXDIR"/ipxe 2>/dev/null
chmod 755 "$OPENSLXDIR"/ipxe 2>/dev/null # if already there
chown -R taskmanager:www-data "$OPENSLXDIR"/ipxe
# Keep care with $OPENSLXDIR, as $OPENSLXDIR/nfs needs other permissions.
mkdir -p -m 755 "$OPENSLXSRVDIR" 2>/dev/null
chmod 775 "$OPENSLXSRVDIR" 2>/dev/null # if already there
chown -R taskmanager:root "$OPENSLXSRVDIR"
chown -R dmsd:images "$OPENSLXSRVDIR"/nfs
mkdir -p -m 755 "$WWWDIR" 2>/dev/null
chmod 755 "$WWWDIR" 2>/dev/null # if already there
chown -R root:root "$WWWDIR"
mkdir -p "$WWWDIR/boot/download"
chown -R taskmanager:www-data "$WWWDIR/boot"
chmod 755 "$WWWDIR/boot" "$WWWDIR/boot/download"
chown -R taskmanager "$TFTPDIR"
mkdir -p -m 755 "$OPENSLXDIR"/proxy 2>/dev/null
chmod 755 "$OPENSLXDIR"/proxy 2>/dev/null # if already there
chown www-data "$OPENSLXDIR"/proxy 2>/dev/null
mkdir -p -m 0755 "$SLXADMINCACHE"
chmod 0755 "$SLXADMINCACHE" # if already there
chown -R www-data:www-data "$SLXADMINCACHE"
}
|