summaryrefslogtreecommitdiffstats
path: root/abs/core/linhes-scripts/system-cleanup.sh
blob: 59a4ebbc6dc70ec6254cd84b0fcfb41aa4a462ee (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
38
39
40
41
42
43
44
45
46
47
#!/bin/bash

# This script cleans up some SVN stuff that the build process leaves
# in /usr/share/mythtv, along with ownership and file permsisions on the
# themes and the mythstream stuff.  There are bunch of files which are
# left executable for no good reason, although I can think of several
# potentially bad reasons for it.

find /usr/share/mythtv -name .svn -print0 | xargs -0 rm -rf
find /usr/share/mythtv -name CVS -print0 | xargs -0 rm -rf

THEMES=/usr/share/mythtv/themes

chown -R root:root $THEMES
chmod -R +r $THEMES
find $THEMES -type f -print0 | xargs -0 chmod a-x


chown -R mythtv:users /myth
chown -R root:root /myth/backup/
chown -R root:root /etc/sv

chown -R http:users /data/srv/httpd/

# None of thes files should be executable.
for ext in gif png jpg xml htm html php ; do
    find / -type f -name "*.$ext" -print0 | xargs -0 chmod a-x
done

# These files should be owned by root and not writable to anybody else

#chown root:root /usr/share/mythtv/*.xml /usr/share/mythtv/*.ttf
chown root:root /usr/share/mythtv/*.ttf

chown -R root:root \
    /usr/share/mythtv/i18n \
    /usr/share/mythtv/mytharchive \
    /usr/share/mythtv/mythflix \
    /usr/share/mythtv/mythnews \
    /usr/share/mythtv/mythvideo \
    /usr/share/mythtv/mythweather \
    /usr/LH 



# Report any remaining orphans...
find / /myth -xdev \( -nouser -o -nogroup \) -ls