forked from mudclient/paotin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
termux-install
executable file
·108 lines (80 loc) · 3.24 KB
/
termux-install
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
#!/usr/bin/env bash
ECHO="$(which echo) -e"
$ECHO;
$ECHO "\e[1;32m第一步,更换镜像为清华源,提高安装速度。\e[m";
$ECHO;
sed -i 's@^\(deb.*stable main\)$@#\1\ndeb https://mirrors.tuna.tsinghua.edu.cn/termux/apt/termux-main stable main@' $PREFIX/etc/apt/sources.list || exit
$ECHO;
$ECHO "\e[1;32m第二步,升级软件仓库。\e[m";
$ECHO;
apt-get update -y
apt-get -o Dpkg::Options::='--force-confold' --force-yes -fuy dist-upgrade
apt-get reinstall -y readline bash
$ECHO;
$ECHO "\e[1;32m第三步,安装依赖。\e[m";
$ECHO;
pkg install -y git clang which make
pkg install -y libgnutls pcre zlib
pkg install -y bash tmux ncurses-utils neovim
$ECHO;
$ECHO "\e[1;32m第四步,申请权限。\e[m";
$ECHO;
function setup-storage() {
while true; do
$ECHO "\e[1;33m请一定要授予存储卡读写权限,否则无法用外部编辑器修改脚本。\e[m";
termux-setup-storage;
sleep 5;
if [ -d ~/storage/shared/ ]; then
break;
fi
done
}
setup-storage
$ECHO;
$ECHO "\e[1;32m第五步,准备本地目录。\e[m";
$ECHO;
mkdir ~/storage/shared/my-paotin
ln -s ~/storage/shared/my-paotin ~/my-paotin
mkdir -p ~/my-paotin/{ids,etc,data,log,plugins}
$ECHO;
$ECHO "\e[1;32m第六步,安装 PaoTin++ 本体。\e[m";
$ECHO;
git clone -b beta http://chat.unix5.com/mudclient/paotin
ln -s ~/my-paotin ~/paotin/var
cd ~/paotin
cp -f ids/EXAMPLE var/ids/例子(文件用ID命名,去掉后缀).txt
cp -f plugins/EXAMPLE.tin var/plugins/例子(文件用拉丁字母命名).tin
$ECHO;
$ECHO "\e[1;32m第七步,安装 TinTin++ 本体。\e[m";
$ECHO;
git clone -b beta-develop http://chat.unix5.com/mudclient/tintin tt
(cd tt/src && ./configure && make)
cp tt/src/tt++ bin/ || exit
$ECHO;
$ECHO "\e[1;32m第八步,安装 nvim 编辑器插件。\e[m";
$ECHO;
mkdir -p .local/share/nvim/site/autoload/
curl https://mirror.ghproxy.com/https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim > .local/share/nvim/site/autoload/plug.vim
mkdir -p .local/share/nvim/plugged
mkdir -p .config/nvim
ln -s ../../init.vim .config/nvim/init.vim
cd .local/share/nvim/plugged
git clone --depth 1 https://mirror.ghproxy.com/https://github.com/dzpao/vim-mbs.git
git clone --depth 1 https://mirror.ghproxy.com/https://github.com/morhetz/gruvbox.git
git clone --depth 1 https://mirror.ghproxy.com/https://github.com/yegappan/mru.git
git clone --depth 1 https://mirror.ghproxy.com/https://github.com/jlanzarotta/BufExplorer.git
git clone --depth 1 https://mirror.ghproxy.com/https://github.com/mhinz/vim-startify.git
$ECHO;
$ECHO "\e[1;32m第九步,设置 PaoTin++ 启动命令。\e[m";
$ECHO;
echo 'alias pt="cd ~/paotin && ./paotin-start"' >> ~/.bashrc
$ECHO;
$ECHO "\e[1;32m安装成功。请重启 termux App,然后输入 pt 即可开始游戏。\e[m";
$ECHO "\e[1;32m以后每次也只需要输入 pt。\e[m";
$ECHO;
$ECHO "\e[1;32m用「文件管理」App 打开你手机根目录,\e[m";
$ECHO "\e[1;32m寻找 my-paotin 目录,找到后,请:\e[m";
$ECHO "\e[1;32m 1,在 ids 目录下存放 ID 启动配置文件;\e[m";
$ECHO "\e[1;32m 2,在 plugins 目录下存放你的机器脚本;\e[m";
$ECHO "\e[1;32m 3,从 QQ 群下载逍遥行数据后存放在 data 目录下。\e[m";
$ECHO;