-
Notifications
You must be signed in to change notification settings - Fork 1
/
rm-files.sh
executable file
·60 lines (49 loc) · 1.04 KB
/
rm-files.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/sh
#
cut_line()
{
echo $1 | cut -c $2
}
echo "" > locales
echo "" > remove_files
cat custom.conf | while read LINE; do
if [ ! -z "$LINE" -a "`echo $LINE | cut -c 1`" != "#" ]; then
# remove this locale
if [ "$(cut_line $LINE 1)" == "l" ]; then
LOCALE="$(cut_line $LINE "1-6")"
# case $LOCALE in
# * ) echo "$LOCALE" >> locales
echo "$LOCALE" >> locales
# esac
fi
#remove this program
if [ "$(cut_line $LINE 1)" = "p" -o "$(cut_line $LINE 1)" = "P" ]; then
PROGRAM="$(cut_line $LINE "1-")"
BEGINN="$(cut_line $LINE "1")"
case $BEGINN in
"p") echo "$PROGRAM\*" >> remove_files;;
"P") echo "$PROGRAM" >> remove_files;;
esac
fi
fi
done
if [ ! -d data ]; then
unzip brahma-palmos -d data > /dev/null || exit
fi
cd data
mv ../locales ./
mv ../remove_files ./
# Removes locales not wanted
cat locales | while read LOCALE; do
if [ -n "$LOCALE" ]; then
LOCALE=${LOCALE:1:5}
#rm *$LOCALE.oprc
fi
done
# Removes programs not wanted
cat remove_files | while read PROG; do
if [ -n "$PROG" ]; then
LOCALE=${LOCALE:1:5}
#rm *$LOCALE.oprc
fi
done