forked from crazykuma/dsm_plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdsm_javbus_patch.sh
112 lines (94 loc) · 5.42 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
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
clear;
# VAR ******************************************************************
vAction=$1;
# Logo ******************************************************************
CopyrightLogo="
DS Video JavBus 搜刮器补丁
==========================================================================";
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://github.com/crazykuma/dsm_plugins/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 -
echo '==========================================================================';
echo "恭喜, DS Video JavBus 搜刮器补丁 安装完成!";
echo '==========================================================================';
}
function upgrade()
{
cd /tmp/;
wget --no-check-certificate https://github.com/crazykuma/dsm_plugins/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 -
echo '==========================================================================';
echo "恭喜, DS Video JavBus 搜刮器补丁 更新完成!";
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 卸载完成!';
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 搜刮器补丁. ';
echo '==========================================================================';
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 搜刮器补丁,无法更新. ';
echo '==========================================================================';
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 搜刮器补丁,无需卸载. ';
echo '==========================================================================';
exit 1;
else
uninstall;
fi;
else
echo '错误的命令';
echo '==========================================================================';
exit 1
fi;