mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-16 04:13:31 +00:00
luci-app-ssr-plus: improve the generation of shadowsocks configuration file (#3838)
This commit is contained in:
parent
180d9be2de
commit
742415490e
@ -108,11 +108,15 @@ gen_config_file() {
|
||||
}
|
||||
EOF
|
||||
local plugin=$(uci_get_by_name $1 plugin)
|
||||
if [ -n "$plugin" ] && [ "$plugin" == "simple-obfs" ]; then
|
||||
plugin="obfs-local"
|
||||
fi
|
||||
if [ -n "$plugin" -a -x "/usr/bin/$plugin" ]; then
|
||||
sed -i "s@$hostip\",@$hostip\",\n\"plugin\": \"$plugin\",\n\"plugin_opts\": \"$(uci_get_by_name $1 plugin_opts)\",@" $config_file
|
||||
if [ -n "$plugin" ]; then
|
||||
if [ "$plugin" == "simple-obfs" ]; then
|
||||
plugin="obfs-local"
|
||||
fi
|
||||
if [ -x "/usr/bin/$plugin" ]; then
|
||||
sed -i "s@$hostip\",@$hostip\",\n\"plugin\": \"$plugin\",\n\"plugin_opts\": \"$(uci_get_by_name $1 plugin_opts)\",@" $config_file
|
||||
else
|
||||
echo "$(date "+%Y-%m-%d %H:%M:%S") Warning!!! SIP003 plugin $plugin not found!!!" >>/tmp/ssrplus.log
|
||||
fi
|
||||
fi
|
||||
elif [ "$stype" == "ssr" ]; then
|
||||
cat <<-EOF >$config_file
|
||||
|
Loading…
Reference in New Issue
Block a user