forked from IxsCN/Aria2Gee
-
Notifications
You must be signed in to change notification settings - Fork 0
/
script
113 lines (102 loc) · 4.77 KB
/
script
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
#!/bin/sh
# Copyright (C) 2016 evenS
install(){
tar xzvf aria2gee.tar.gz -C /
cp ./Aria2Gee.conf /etc/aria2gee/Aria2Gee.conf
. ./Aria2Gee.conf
sed -i "s#xxxxxx#$pwd#g" /etc/aria2gee/aria2c.conf
sed -i "s#/tmp/data/AriaDowbload/#$path#g" /etc/aria2gee/aria2c.conf
mac=$(lua -e "print(require'tw'.get_mac())")
mac=${mac:6:8}
sed -i "s#FFFFFFFF#$mac#g" /etc/aria2gee/frp.ini
mkdir -p $path
chmod 777 $path
<<<<<<< HEAD
=======
chmod 777 $path/*
>>>>>>> origin/master
touch /etc/config/samba
uci set samba.aria2gee=sambashare
uci set samba.aria2gee.name=aria2gee
uci set samba.aria2gee.read_only=no
uci set samba.aria2gee.create_mask=0777
uci set samba.aria2gee.dir_mask=0777
uci set samba.aria2gee.path="$path"
uci set samba.aria2gee.guest_ok=yes
uci commit samba
/etc/init.d/samba restart
rm /dev/null
mknod /dev/null c 1 3
chmod 666 /dev/null
start
}
uninstall(){
stop
uci delete samba.aria2gee
uci commit samba
/etc/init.d/samba restart
rm -rf /tmp/cryptdata/usr/bin/aria2c /tmp/cryptdata/usr/bin/frpc /etc/aria2gee/ /etc/init.d/aria2gee.sh
}
status() {
. /etc/aria2gee/Aria2Gee.conf
if [ `pidof aria2c` ]; then
stat="running"
else
stat="stopped"
fi
currentpath=$path
mac=$(lua -e "print(require'tw'.get_mac())")
mac=${mac:6:8}
url="http://$mac.aria2gee.com:6800/jsonrpc||$pwd"
url=$(echo -n $url | /tmp/cryptdata/usr/bin/base64)
url="http://nemoalex.github.io/glutton/?s="$url
basepwd=$(echo -n $pwd | /tmp/cryptdata/usr/bin/base64)
<<<<<<< HEAD
ariangurl="http://aria2gee.com/#/settings/rpc/set/http/$mac.aria2gee.com/6800/jsonrpc/$basepwd"
ariangurl1="http://ariang.mayswind.net/latest/#/settings/rpc/set/http/$mac.aria2gee.com/6800/jsonrpc/$basepwd"
rpcpath="http://token:$pwd@$mac.aria2gee.com:6800/jsonrpc"
=======
ariangurl="http://marixs.com/AriaNG/#/settings/rpc/set/http/$mac.marixs.com/6800/jsonrpc/$basepwd"
ariangurl1="http://ariang.mayswind.net/latest/#/settings/rpc/set/http/$mac.marixs.com/6800/jsonrpc/$basepwd"
rpcpath="http://token:$pwd@$mac.marixs.com:6800/jsonrpc"
frpstatus=$(cat /tmp/ariaStatus )
>>>>>>> origin/master
df -h | grep -E "sda|mmcblk" > /tmp/ariatmp
while read line
do
linepath=$(echo $line | awk 'NR==1{print $6}')
hardname=$(echo $linepath | awk -F '/' 'NR==1{print $4}')
if [ $(echo $linepath | grep sda -c ) == 1 ]; then
kind="USB设备"
name=$(uci get samba.$hardname.name)
elif [ $(echo $linepath | grep mmcblk -c ) == 1 ]; then
kind="内存卡"
name="无"
fi
use=$(echo $line | awk 'NR==1{print $5}')
size=$(echo $line | awk 'NR==1{print $2}')
storageinfo=$storageinfo"类型:$kind;名字:$name;总容量:$size;使用率:$use;路径:$linepath<br>"
done < /tmp/ariatmp
rm -rf /tmp/ariatmp
<<<<<<< HEAD
httpcode=$(curl -I -m 3 -o /dev/null -s -w %{http_code} http://$mac.aria2gee.com:6800)
if [ $httpcode == "404" ]; then
frpstatus="内网穿透正常"
else
frpstatus="内网穿透异常"
fi
msg="↓↓Server↓↓<br>$mac.aria2gee.com<br>↓↓Port↓↓<br>6800<br>↓↓token↓↓<br>$pwd<br>↓↓RPC path↓↓<br>$rpcpath<br>↓↓内网穿透状态(仅供参考)↓↓<br>$frpstatus <br>↓↓存储设备信息↓↓<br>$storageinfo↓↓默认下载位置↓↓<br>$currentpath<br><br><a href=\\\"$url\\\" >新手直达链接(app端不可用)</a><br><a href=\\\"$ariangurl1\\\">高级直达链接(app端可用)</a><br><a href=\\\"$ariangurl\\\">高级直达链接.备用(app端可用)</a><br>↓↓samba共享地址链接↓↓<br>\\\\\\\hiwifi\\\Aria2Gee\\\<br><a href=\\\"https://stray.farbox.com/hiwifi/aria2geejiao-cheng\\\">高级教程</a>"
=======
msg="↓↓Server↓↓<br>$mac.marixs.com<br>↓↓Port↓↓<br>6800<br>↓↓token↓↓<br>$pwd<br>↓↓RPC path↓↓<br>$rpcpath<br><br>↓↓内网穿透状态(仅供参考)↓↓<br>$frpstatus <br>↓↓存储设备信息↓↓<br>$storageinfo↓↓默认下载位置↓↓<br>$currentpath<br><br><a href=\\\"$url\\\" >新手直达链接(app端不可用)</a><br><a href=\\\"$ariangurl1\\\">高级直达链接(app端可用)</a><br><a href=\\\"$ariangurl\\\">高级直达链接.备用(app端可用)</a><br>↓↓samba共享地址链接↓↓<br>\\\\\\\hiwifi\\\Aria2Gee\\\<br><a href=\\\"https://stray.farbox.com/hiwifi/aria2geejiao-cheng\\\">高级教程</a>"
>>>>>>> origin/master
echo "{ \"status\" : \"$stat\", \"msg\" : \" $msg\"}"
return 0
}
start() {
/etc/init.d/aria2gee.sh enable
/etc/init.d/aria2gee.sh start
}
stop() {
/etc/init.d/aria2gee.sh disable
/etc/init.d/aria2gee.sh stop
}