运行此脚本时,我什么也没有返回。有什么建议么?这是代码。
securityTlsVersion() {
local file="/usr/lib/firefox/mozilla.cfg"
local config=`more $file|grep security.tls.version.max`
local tlsmax="lockPref(\"security.tls.version.max`
if [ "`hostname`" == "server1" ] || [ "`hostname`" == "server2" ];then
if [ "$config" = "" ]; then
echo "Adding security.tls.version.max line to mozilla.cfg"
echo "tlsmax >> $file
echo "security.tls.version.max is now configured"
else
echo "security.tls.version.max is already configured"
fi
fi
}
答案 0 :(得分:0)
下面是shellcheck
的结果。这意味着第一行包含未闭合的"
。正如@JNevill所写,这是从local tlsmax
开始的行:
shellcheck myscript.sh
In myscript.sh line 7:
if [ "`hostname`" == "server1" ] || [ "`hostname`" == "server2" ];then
^-- SC1009: The mentioned parser error was in this test expression.
^-- SC1073: Couldn't parse this double quoted string.
^-- SC1072: Expected end of double quoted string. Fix any mentioned problems and try again.
对您有帮助吗?