-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathapt-nyaa
More file actions
executable file
·43 lines (39 loc) · 1.42 KB
/
apt-nyaa
File metadata and controls
executable file
·43 lines (39 loc) · 1.42 KB
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
#!/bin/sh
# wget http://goo.gl/ebE6Z -O apt-nyaa && sudo chmod +x apt-nyaa && sudo mv apt-nyaa /usr/bin/apt-nyaa
if [ `id -u` = 0 ]; then
echo "apt-nyaa launched by root, will exit now"
echo "please launch as normal user"
exit 0
fi
cd /tmp
if [ "$1" = "install" ]; then
if [ "$2" = "" ]; then
echo "install need parameter"
else
wget -Nq https://raw.github.com/nyaa/UbuntuScript/master/FirstInstall/$2.sh
chmod +x $2.sh
./$2.sh $3
rm $2.sh
fi
elif [ "$1" = "list" ]; then
wget -Nq https://raw.github.com/nyaa/UbuntuScript/master/FirstInstall/list.txt
echo "You can install:"
cat list.txt
rm list.txt
elif [ "$1" = "search" ]; then
wget -Nq https://raw.github.com/nyaa/UbuntuScript/master/FirstInstall/list.txt
cat list.txt | grep $2
rm list.txt
elif [ "$1" = "cat" ]; then
wget -Nq https://raw.github.com/nyaa/UbuntuScript/master/FirstInstall/$2.sh
less $2.sh
rm $2.sh
elif [ "$1" = "help" ]; then
echo "apt-nyaa ver 0.0.4\nUsage:\napt-nyaa install SOME_APP\napt-nyaa cat SOMETHING #look source code\napt-nyaa search SOMETHING\napt-nyaa list\napt-nyaa help\napt-nyaa upgrade"
elif [ "$1" = "upgrade" ]; then
sudo apt-get --assume-yes install wget > /dev/null 2>&1 && cd /usr/bin/ && sudo wget -Nq https://raw.github.com/nyaa/UbuntuScript/master/apt-nyaa && sudo chmod +x apt-nyaa
exit 0
echo "Upgrading is finished.. or it seems so"
else
echo "$1: command not found"
fi