forked from MoeClub/Note
-
Notifications
You must be signed in to change notification settings - Fork 0
/
AriaNgGUI.sh
28 lines (22 loc) · 1.01 KB
/
AriaNgGUI.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
#!/bin/bash
FileBaseName="AriaNgGUI.app.tar.gz"
TMPDIR="$(echo $HOME)/Downloads/AriaNgGUI"
rm -rf "${TMPDIR}"
mkdir -p "${TMPDIR}"
cd "${TMPDIR}"
## Package
#tar -zcvf ./AriaNgGUI.app.tar.gz ./AriaNgGUI.app
#cat ./AriaNgGUI.app.tar.gz |split -b 20m -a 3 - AriaNgGUI.app.tar.gz.
## Download
for num in {1..4}; do
[ $num -lt 10 ] && FileName="${FileBaseName}.00${num}"
[ $num -ge 10 ] && [ $num -lt 100 ] && FileName="${FileBaseName}.0${num}"
[ $num -ge 100 ] && FileName="${FileBaseName}.${num}"
echo "Download: ${FileName}..."
curl -sSL -o "${FileName}" "https://raw.githubusercontent.com/MoeClub/Note/master/AriaNgGUI/AriaNgGUI.app/${FileName}"
done
## Install
[ -e "$HOME/Library/Application Support/aria-ng-gui" ] && rm -rf "$HOME/Library/Application Support/aria-ng-gui"
[ -e "/Applications/AriaNgGUI.app" ] && rm -rf "/Applications/AriaNgGUI.app"
tar xvf <(cat AriaNgGUI.app.tar.gz.001 AriaNgGUI.app.tar.gz.002 AriaNgGUI.app.tar.gz.003 AriaNgGUI.app.tar.gz.004) -C "/Applications"
cd ../ && rm -rf "${TMPDIR}"