mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-22 08:38:03 +01:00
escape special characters used in sed
This commit is contained in:
parent
f4e0d3c774
commit
01dc77b606
@ -92,7 +92,8 @@ function configureHarborCfg {
|
||||
|
||||
if [ -n "$cfg_key" ]
|
||||
then
|
||||
sed -i -r s%"#?$cfg_key\s*=\s*.*"%"$cfg_key = $cfg_value"% $cfg_file
|
||||
cfg_value=$(echo "$cfg_value" | sed -r -e 's%[\/&%]%\\&%g')
|
||||
sed -i -r "s%#?$cfg_key\s*=\s*.*%$cfg_key = $cfg_value%" $cfg_file
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -184,16 +184,11 @@ do
|
||||
echo "Read attribute using ovfenv: [ $attr ]"
|
||||
value=$(ovfenv -k $attr)
|
||||
|
||||
#ldap search password and email password can be null
|
||||
if [ -n "$value" ] || [ "$attr" = "ldap_search_pwd" ] \
|
||||
|| [ "$attr" = "email_password" ]
|
||||
then
|
||||
#if [ "$attr" = ldap_search_pwd ] \
|
||||
# || [ "$attr" = email_password ]
|
||||
#then
|
||||
# bs=$(echo $value | base64)
|
||||
# value={base64}$bs
|
||||
#fi
|
||||
configureHarborCfg $attr $value
|
||||
fi
|
||||
#if [ "$attr" = ldap_search_pwd ] \
|
||||
# || [ "$attr" = email_password ]
|
||||
#then
|
||||
# bs=$(echo $value | base64)
|
||||
# value={base64}$bs
|
||||
#fi
|
||||
configureHarborCfg "$attr" "$value"
|
||||
done
|
Loading…
Reference in New Issue
Block a user