-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathbuild_script_archive
More file actions
executable file
·114 lines (103 loc) · 2.29 KB
/
build_script_archive
File metadata and controls
executable file
·114 lines (103 loc) · 2.29 KB
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#!/bin/bash
DIRECTORY="$HOME/PlayOnLinux_Scripts"
SITE=http://repository.playonlinux.com
TODAY=$(date +%Y%m%d)
VERSION=$(wget $SITE/version2.php -O- -q 2> /dev/null)
VERSION_MAC=$(wget $SITE/version_mac.php -O- -q 2> /dev/null)
whatis()
{
if [ "$1" == 0 ]
then
echo "Other"
fi
if [ "$1" == 1 ]
then
echo "Games"
fi
if [ "$1" == 2 ]
then
echo "Accessories"
fi
if [ "$1" == 3 ]
then
echo "Office"
fi
if [ "$1" == 4 ]
then
echo "Internet"
fi
if [ "$1" == 5 ]
then
echo "Multimedia"
fi
if [ "$1" == 6 ]
then
echo "Graphics"
fi
if [ "$1" == 7 ]
then
echo "Development"
fi
if [ "$1" == 8 ]
then
echo "Education"
fi
if [ "$1" == 9 ]
then
echo "Patches"
fi
if [ "$1" == 10 ]
then
echo "Testing"
fi
if [ "$1" == 100 ]
then
echo "Functions"
fi
}
process()
{
read line
while [ "$line" != "" ]
do
file=$(echo "$line" | cut -d "/" -f 2)
cat=$(echo "$line" | cut -d "/" -f 1)
rcat=$(whatis $cat)
echo "Adding $file"
mkdir -p "$DIRECTORY/$rcat"
wget -q "$SITE/V4_data/repository/get_file.php?id=$file" -O- 2> /dev/null > "$DIRECTORY/$rcat/$file"
read line
done
}
rm -r $DIRECTORY
mkdir -p $DIRECTORY
cd $DIRECTORY
echo "Writting version : $VERSION"
echo $VERSION > VERSION
echo "Writting mac : $VERSION_MAC"
printf $VERSION_MAC > VERSION_MAC
echo "Dating archive : $TODAY"
echo $TODAY > DATE
echo "Building directories"
mkdir -p Games
mkdir -p Accessories
mkdir -p Development
mkdir -p Education
mkdir -p Functions
mkdir -p Games
mkdir -p Graphics
mkdir -p Internet
mkdir -p Multimedia
mkdir -p Office
mkdir -p Other
mkdir -p Patches
mkdir -p Testing
echo "Downloading all scripts from MySQL ..."
wget -q $SITE/V4_data/repository/get_local.php -O- 2> /dev/null | process
#echo "Building .tar.gz file"
#cd $DIRECTORY
#cd ..
#tar -czvf PlayOnLinux_Scripts.tar.gz PlayOnLinuxData
#echo "Copying .tar.gz file"
#cp PlayOnLinux_Scripts.tar.gz ../www/script_files/
echo "Done"