Skip to content

Commit

Permalink
Format Code && Change File EOL && Add VSCode Config
Browse files Browse the repository at this point in the history
格式化代码
修改version文件换行符为Linux换行符
增加VSCode配置
  • Loading branch information
FJX_SJ committed Jun 9, 2020
1 parent ba83e7d commit 3071bd0
Show file tree
Hide file tree
Showing 13 changed files with 281 additions and 266 deletions.
4 changes: 4 additions & 0 deletions pushplus/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,9 @@
"[bat]": {
"files.encoding": "gb2312",
"files.eol": "\r\n",
},
"files.associations": {
"*.sh": "shellscript",
"version": "shellscript"
}
}
10 changes: 5 additions & 5 deletions pushplus/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ DESCRIPTION="通过pushplus将路由器状态推送到微信上"
HOME_URL="Module_pushplus.asp"

# Check and include base
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
if [ "$MODULE" == "" ]; then
echo "module not found"
exit 1
echo "module not found"
exit 1
fi

if [ -f "$DIR/$MODULE/$MODULE/install.sh" ]; then
echo "install script not found"
exit 2
echo "install script not found"
exit 2
fi

# now include build_base.sh
Expand Down
106 changes: 53 additions & 53 deletions pushplus/pushplus/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,58 +10,58 @@ DIR=$(

# 获取固件类型
_get_type() {
local FWTYPE=$(nvram get extendno|grep koolshare)
if [ -d "/koolshare" ];then
if [ -n $FWTYPE ];then
echo "koolshare官改固件"
else
echo "koolshare梅林改版固件"
fi
else
if [ "$(uname -o|grep Merlin)" ];then
echo "梅林原版固件"
else
echo "华硕官方固件"
fi
fi
local FWTYPE=$(nvram get extendno | grep koolshare)
if [ -d "/koolshare" ]; then
if [ -n $FWTYPE ]; then
echo "koolshare官改固件"
else
echo "koolshare梅林改版固件"
fi
else
if [ "$(uname -o | grep Merlin)" ]; then
echo "梅林原版固件"
else
echo "华硕官方固件"
fi
fi
}

exit_install(){
local state=$1
case $state in
1)
echo_date "本插件适用于适用于【koolshare 梅林改/官改 hnd/axhnd/axhnd.675x】固件平台,你的固件平台不能安装!!!"
echo_date "本插件支持机型/平台:https://github.com/koolshare/rogsoft#rogsoft"
echo_date "退出安装!"
rm -rf /tmp/${module}* >/dev/null 2>&1
exit 1
;;
0|*)
rm -rf /tmp/${module}* >/dev/null 2>&1
exit 0
;;
esac
exit_install() {
local state=$1
case $state in
1)
echo_date "本插件适用于适用于【koolshare 梅林改/官改 hnd/axhnd/axhnd.675x】固件平台,你的固件平台不能安装!!!"
echo_date "本插件支持机型/平台:https://github.com/koolshare/rogsoft#rogsoft"
echo_date "退出安装!"
rm -rf /tmp/${module}* >/dev/null 2>&1
exit 1
;;
0 | *)
rm -rf /tmp/${module}* >/dev/null 2>&1
exit 0
;;
esac
}

# 判断路由架构和平台
case $(uname -m) in
aarch64)
if [ "$(uname -o|grep Merlin)" -a -d "/koolshare" ];then
echo_date 机型:$MODEL $(_get_type) 符合安装要求,开始安装插件!
else
exit_install 1
fi
;;
armv7l)
if [ "$MODEL" == "TUF-AX3000" -o "$MODEL" == "RT-AX82U" ] && [ -d "/koolshare" ];then
echo_date 机型:$MODEL $(_get_type) 符合安装要求,开始安装插件!
else
exit_install 1
fi
;;
*)
exit_install 1
;;
aarch64)
if [ "$(uname -o | grep Merlin)" -a -d "/koolshare" ]; then
echo_date 机型:$MODEL $(_get_type) 符合安装要求,开始安装插件!
else
exit_install 1
fi
;;
armv7l)
if [ "$MODEL" == "TUF-AX3000" -o "$MODEL" == "RT-AX82U" ] && [ -d "/koolshare" ]; then
echo_date 机型:$MODEL $(_get_type) 符合安装要求,开始安装插件!
else
exit_install 1
fi
;;
*)
exit_install 1
;;
esac

if [ "$MODEL" == "GT-AC5300" ] || [ "$MODEL" == "GT-AX11000" ] || [ -n "$(nvram get extendno | grep koolshare)" -a "$MODEL" == "RT-AC86U" ]; then
Expand Down Expand Up @@ -92,14 +92,14 @@ rm -rf /koolshare/scripts/pushplus_*
cp -rf /tmp/pushplus/res/icon-pushplus.png /koolshare/res/
cp -rf /tmp/pushplus/scripts/* /koolshare/scripts/
cp -rf /tmp/pushplus/webs/Module_pushplus.asp /koolshare/webs/
if [ "$ROG" == "1" ];then
continue
if [ "$ROG" == "1" ]; then
continue
else
if [ "$TUF" == "1" ];then
sed -i 's/3e030d/3e2902/g;s/91071f/92650F/g;s/680516/D0982C/g;s/cf0a2c/c58813/g;s/700618/74500b/g;s/530412/92650F/g' /koolshare/webs/Module_${module}.asp >/dev/null 2>&1
else
sed -i '/rogcss/d' /koolshare/webs/Module_${module}.asp >/dev/null 2>&1
fi
if [ "$TUF" == "1" ]; then
sed -i 's/3e030d/3e2902/g;s/91071f/92650F/g;s/680516/D0982C/g;s/cf0a2c/c58813/g;s/700618/74500b/g;s/530412/92650F/g' /koolshare/webs/Module_${module}.asp >/dev/null 2>&1
else
sed -i '/rogcss/d' /koolshare/webs/Module_${module}.asp >/dev/null 2>&1
fi
fi
chmod +x /koolshare/scripts/*
# 安装重启自动启动功能
Expand Down
4 changes: 4 additions & 0 deletions routerhook/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,9 @@
"[bat]": {
"files.encoding": "gb2312",
"files.eol": "\r\n",
},
"files.associations": {
"*.sh": "shellscript",
"version": "shellscript"
}
}
97 changes: 50 additions & 47 deletions routerhook/routerhook/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,62 +3,65 @@ source /koolshare/scripts/base.sh
alias echo_date='echo 【$(TZ=UTC-8 date -R +%Y年%m月%d日\ %X)】:'
MODEL=$(nvram get productid)
module=routerhook
DIR=$(cd $(dirname $0); pwd)
DIR=$(
cd $(dirname $0)
pwd
)

# 获取固件类型
_get_type() {
local FWTYPE=$(nvram get extendno|grep koolshare)
if [ -d "/koolshare" ];then
if [ -n $FWTYPE ];then
echo "koolshare官改固件"
else
echo "koolshare梅林改版固件"
fi
else
if [ "$(uname -o|grep Merlin)" ];then
echo "梅林原版固件"
else
echo "华硕官方固件"
fi
fi
local FWTYPE=$(nvram get extendno | grep koolshare)
if [ -d "/koolshare" ]; then
if [ -n $FWTYPE ]; then
echo "koolshare官改固件"
else
echo "koolshare梅林改版固件"
fi
else
if [ "$(uname -o | grep Merlin)" ]; then
echo "梅林原版固件"
else
echo "华硕官方固件"
fi
fi
}

exit_install(){
local state=$1
case $state in
1)
echo_date "本插件适用于适用于【koolshare 梅林改/官改 hnd/axhnd/axhnd.675x】固件平台,你的固件平台不能安装!!!"
echo_date "本插件支持机型/平台:https://github.com/koolshare/rogsoft#rogsoft"
echo_date "退出安装!"
rm -rf /tmp/${module}* >/dev/null 2>&1
exit 1
;;
0|*)
rm -rf /tmp/${module}* >/dev/null 2>&1
exit 0
;;
esac
exit_install() {
local state=$1
case $state in
1)
echo_date "本插件适用于适用于【koolshare 梅林改/官改 hnd/axhnd/axhnd.675x】固件平台,你的固件平台不能安装!!!"
echo_date "本插件支持机型/平台:https://github.com/koolshare/rogsoft#rogsoft"
echo_date "退出安装!"
rm -rf /tmp/${module}* >/dev/null 2>&1
exit 1
;;
0 | *)
rm -rf /tmp/${module}* >/dev/null 2>&1
exit 0
;;
esac
}

# 判断路由架构和平台
case $(uname -m) in
aarch64)
if [ "$(uname -o|grep Merlin)" -a -d "/koolshare" ];then
echo_date 机型:$MODEL $(_get_type) 符合安装要求,开始安装插件!
else
exit_install 1
fi
;;
armv7l)
if [ "$MODEL" == "TUF-AX3000" -o "$MODEL" == "RT-AX82U" ] && [ -d "/koolshare" ];then
echo_date 机型:$MODEL $(_get_type) 符合安装要求,开始安装插件!
else
exit_install 1
fi
;;
*)
exit_install 1
;;
aarch64)
if [ "$(uname -o | grep Merlin)" -a -d "/koolshare" ]; then
echo_date 机型:$MODEL $(_get_type) 符合安装要求,开始安装插件!
else
exit_install 1
fi
;;
armv7l)
if [ "$MODEL" == "TUF-AX3000" -o "$MODEL" == "RT-AX82U" ] && [ -d "/koolshare" ]; then
echo_date 机型:$MODEL $(_get_type) 符合安装要求,开始安装插件!
else
exit_install 1
fi
;;
*)
exit_install 1
;;
esac

if [ "$MODEL" == "GT-AC5300" ] || [ "$MODEL" == "GT-AX11000" ] || [ -n "$(nvram get extendno | grep koolshare)" -a "$MODEL" == "RT-AC86U" ]; then
Expand Down
4 changes: 4 additions & 0 deletions serverchan/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,9 @@
"[bat]": {
"files.encoding": "gb2312",
"files.eol": "\r\n",
},
"files.associations": {
"*.sh": "shellscript",
"version": "shellscript"
}
}
10 changes: 5 additions & 5 deletions serverchan/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ DESCRIPTION="从路由器推送状态及通知的工具"
HOME_URL="Module_serverchan.asp"

# Check and include base
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
if [ "$MODULE" == "" ]; then
echo "module not found"
exit 1
echo "module not found"
exit 1
fi

if [ -f "$DIR/$MODULE/$MODULE/install.sh" ]; then
echo "install script not found"
exit 2
echo "install script not found"
exit 2
fi

# now include build_base.sh
Expand Down
Loading

0 comments on commit 3071bd0

Please sign in to comment.