-
Notifications
You must be signed in to change notification settings - Fork 2
/
dsm_javbus_patch.sh
119 lines (101 loc) · 5.73 KB
/
dsm_javbus_patch.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
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
115
116
117
118
119
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
clear;
# VAR ******************************************************************
vVersion='1.3';
vAction=$1;
# Logo ******************************************************************
CopyrightLogo="
DS Video JavBus 搜刮器补丁 $vVersion QQ 群:160128165
==========================================================================";
echo "$CopyrightLogo";
# Function List *******************************************************************************
function install()
{
cd /tmp/;
wget https://bootstrap.pypa.io/ez_setup.py -O - | python && easy_install pip && pip install requests && pip install bs4 && pip install lxml
mv /var/packages/VideoStation/target/plugins/syno_themoviedb/search.php /var/packages/VideoStation/target/plugins/syno_themoviedb/search.php.javback
mv /var/packages/VideoStation/target/plugins/syno_synovideodb/search.php /var/packages/VideoStation/target/plugins/syno_synovideodb/search.php.javback
wget --no-check-certificate https://gitee.com/challengerV/dsm_javdb_patch/raw/master/dsm_javbus_patch.tar -O dsm_javbus_patch.tar;
tar -xvf dsm_javbus_patch.tar
cp -rfa ./dsm_javbus_patch/syno_themoviedb /var/packages/VideoStation/target/plugins/;
cp -rfa ./dsm_javbus_patch/syno_synovideodb /var/packages/VideoStation/target/plugins/;
chmod 0755 /var/packages/VideoStation/target/plugins/syno_themoviedb/search.php
chmod 0755 /var/packages/VideoStation/target/plugins/syno_themoviedb/list.py
chmod 0755 /var/packages/VideoStation/target/plugins/syno_themoviedb/data.py
chmod 0755 /var/packages/VideoStation/target/plugins/syno_synovideodb/search.php
chown VideoStation:VideoStation /var/packages/VideoStation/target/plugins/syno_themoviedb/search.php
chown VideoStation:VideoStation /var/packages/VideoStation/target/plugins/syno_synovideodb/search.php
cd -
rm -rf dsm_javbus_patch.sh
echo '==========================================================================';
echo "恭喜, DS Video JavBus 搜刮器补丁 $vVersion 安装完成!";
echo '==========================================================================';
}
function upgrade()
{
cd /tmp/;
wget --no-check-certificate https://gitee.com/challengerV/dsm_javdb_patch/raw/master/dsm_javbus_patch.tar -O dsm_javbus_patch.tar;
tar -xvf dsm_javbus_patch.tar
cp -rfa ./dsm_javbus_patch/syno_themoviedb /var/packages/VideoStation/target/plugins/;
cp -rfa ./dsm_javbus_patch/syno_synovideodb /var/packages/VideoStation/target/plugins/;
chmod 0755 /var/packages/VideoStation/target/plugins/syno_themoviedb/search.php
chmod 0755 /var/packages/VideoStation/target/plugins/syno_themoviedb/list.py
chmod 0755 /var/packages/VideoStation/target/plugins/syno_themoviedb/data.py
chmod 0755 /var/packages/VideoStation/target/plugins/syno_synovideodb/search.php
chown VideoStation:VideoStation /var/packages/VideoStation/target/plugins/syno_themoviedb/search.php
chown VideoStation:VideoStation /var/packages/VideoStation/target/plugins/syno_synovideodb/search.php
cd -
rm -rf dsm_javbus_patch.sh
echo '==========================================================================';
echo "恭喜, DS Video JavBus 搜刮器补丁 $vVersion 更新完成!";
echo '==========================================================================';
}
function uninstall()
{
rm /var/packages/VideoStation/target/plugins/syno_themoviedb/list.py
rm /var/packages/VideoStation/target/plugins/syno_themoviedb/data.py
mv -f /var/packages/VideoStation/target/plugins/syno_themoviedb/search.php.javback /var/packages/VideoStation/target/plugins/syno_themoviedb/search.php
mv -f /var/packages/VideoStation/target/plugins/syno_synovideodb/search.php.javback /var/packages/VideoStation/target/plugins/syno_synovideodb/search.php
chmod 0755 /var/packages/VideoStation/target/plugins/syno_themoviedb/search.php
chmod 0755 /var/packages/VideoStation/target/plugins/syno_synovideodb/search.php
chown VideoStation:VideoStation /var/packages/VideoStation/target/plugins/syno_themoviedb/search.php
chown VideoStation:VideoStation /var/packages/VideoStation/target/plugins/syno_synovideodb/search.php
echo 'DS Video JavBus Patch 卸载完成! QQ 群:160128165';
echo '==========================================================================';
}
# SHELL ******************************************************************
if [ "$vAction" == 'install' ]; then
if [ ! -f "/var/packages/VideoStation/target/plugins/syno_themoviedb/search.php.javback" ]; then
install;
else
echo '你已经安装过 DS Video JavBus 或 JavDB 搜刮器补丁. QQ 群:160128165';
echo '==========================================================================';
rm -rf dsm_javbus_patch.sh
exit 1;
fi;
elif [ "$vAction" == 'upgrade' ]; then
if [ ! -f "/var/packages/VideoStation/target/plugins/syno_themoviedb/search.php.javback" ]; then
echo '你还没安装过 installed DS Video JavBus 搜刮器补丁,无法更新. QQ 群:160128165';
echo '==========================================================================';
rm -rf dsm_javbus_patch.sh
exit 1;
else
upgrade;
fi;
elif [ "$vAction" == 'uninstall' ]; then
if [ ! -f "/var/packages/VideoStation/target/plugins/syno_themoviedb/search.php.javback" ]; then
echo '你还没安装过 installed DS Video JavBus 搜刮器补丁,无需卸载. QQ 群:160128165';
echo '==========================================================================';
rm -rf dsm_javbus_patch.sh
exit 1;
else
uninstall;
fi;
else
echo '错误的命令';
echo '==========================================================================';
rm -rf dsm_javbus_patch.sh
exit 1
fi;