summaryrefslogtreecommitdiffstats
path: root/cron-jobs/adjust-permissions
blob: 6670a6f25484d49b81581663ee7c2db6bfc2d7ee (plain)
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
#!/bin/sh

if [ -f /tmp/.ftpmaint.lck ]; then
	exit 0
fi

/bin/touch /tmp/.ftpmaint.lck

#adjust the nice level to run at a lower priority
/usr/bin/renice +10 -p $$ > /dev/null

cd /srv/ftp
if [ -d "core" ]; then
    #This is unique to gerolde (main arch server)
    /bin/chown -R ftp:ftp-arch core/os/any
    /bin/chown -R ftp:ftp-arch core/os/i686
    /bin/chown -R ftp:ftp-arch core/os/x86_64
    /bin/chown -R ftp:ftp-extra {extra,testing}/os/any
    /bin/chown -R ftp:ftp-extra {extra,testing}/os/i686
    /bin/chown -R ftp:ftp-extra {extra,testing}/os/x86_64
    for d in core extra testing; do
        /bin/chmod -R g+w $d/os/any
        /bin/chmod -R g+w $d/os/i686
        /bin/chmod -R g+w $d/os/x86_64
    done
else
    /bin/chown -R root:tusers {community,community-testing}/os/any
    /bin/chown -R root:tusers {community,community-testing}/os/i686
    /bin/chown -R root:tusers {community,community-testing}/os/x86_64
    /bin/chmod -R g+w {community,community-testing}/os/any
    /bin/chmod -R g+w {community,community-testing}/os/i686
    /bin/chmod -R g+w {community,community-testing}/os/x86_64
fi

/bin/chmod 555 /srv/ftp

rm -f /tmp/.ftpmaint.lck