summarylogtreecommitdiffstats
path: root/usc-dlcha
blob: e584f98e45babf9ba341f387b82b137d6589578c (plain)
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
#!/bin/bash
cd /opt/usc-game-v0.5.0/bin/songs/nautica/
mkdir dltmp
cd dltmp
url=$(dialog --title "下載圖譜" --inputbox "下載鏈接\nhttps://ksm.dev/\n(Download右鍵複製鏈接)" 0 0 2>&1 >> /dev/tty)
if [ "$url" = "" ]
then
    dialog --infobox "沒有輸入鏈接!" 0 0
    sleep 1
    exit
fi
curl -L -o download.zip $url
unzip download.zip
rm -rf download.zip
fcount=$(ls -1 | wc -l)
if [ $fcount -eq 1 ]
then
    mv * ../
    cd ../
    rmdir dltmp
else
    title=$(cat "$(find ./ -name "*.ksh" | head -n 1)" | head -n 1 | cut -d = -f 2)
    cd ../
    mv dltmp "$title"
fi