From c0445fec0d0874d3c516fe58e1491592ed7775f8 Mon Sep 17 00:00:00 2001 From: wukongdaily <2666180@gmail.com> Date: Fri, 22 Sep 2023 22:59:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0prepare.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 如果要运行更多函数 建议先执行它 --- drive-gl-inet.sh | 11 +++++++++-- prepare.sh | 12 ++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 prepare.sh diff --git a/drive-gl-inet.sh b/drive-gl-inet.sh index a89f55c..b7b5845 100644 --- a/drive-gl-inet.sh +++ b/drive-gl-inet.sh @@ -1,4 +1,11 @@ #!/bin/sh -opkg update -opkg install bash +check_bash_installed() { + if [ -x "/bin/bash" ]; then + echo "downloading gl-inet.sh ......" + else + opkg update + opkg install bash + fi +} +check_bash_installed wget -O /tmp/gl-inet.sh https://ghproxy.com/https://raw.githubusercontent.com/wukongdaily/gl-inet-onescript/master/gl-inet.sh && chmod +x /tmp/gl-inet.sh && /tmp/gl-inet.sh diff --git a/prepare.sh b/prepare.sh new file mode 100644 index 0000000..201633b --- /dev/null +++ b/prepare.sh @@ -0,0 +1,12 @@ +#!/bin/bash +# 默认情况下MT3000和MT2500A的环境是ash +# 建议安装bash 满足更多的函数调用 +check_bash_installed() { + if [ -x "/bin/bash" ]; then + echo "downloading gl-inet.sh ......" + else + opkg update + opkg install bash + fi +} +check_bash_installed \ No newline at end of file