sed expression error in add_web_config()
-
- Posts: 5
- Joined: Tue Mar 11, 2014 4:43 pm
sed expression error in add_web_config()
I could not figure out why my apache2.conf and nginx.conf were not being generated so after many hours of trying to figure out how VestaCP creates those files I finally noticed a sed error when /forward/slash paths were being used so I did a wholesale replacement of / to # and now my config files are being generated successfully.
Same problem here but I haven't tracked the function() down yet...
Code: Select all
~ /usr/local/vesta diff -u func/domain.sh.bkp func/domain.sh
--- func/domain.sh.bkp 2014-03-12 19:06:27.214539999 +1000
+++ func/domain.sh 2014-03-12 19:08:49.446539999 +1000
@@ -224,31 +224,31 @@
# Add web config
add_web_config() {
cat $tpl_file | \
- sed -e "s/%ip%/$ip/g" \
- -e "s/%web_system%/$WEB_SYSTEM/g" \
- -e "s/%web_port%/$WEB_PORT/g" \
- -e "s/%web_ssl_port%/$WEB_SSL_PORT/g" \
- -e "s/%rgroups%/$WEB_RGROUPS/g" \
- -e "s/%proxy_system%/$PROXY_SYSTEM/g" \
- -e "s/%proxy_port%/$PROXY_PORT/g" \
- -e "s/%proxy_ssl_port%/$PROXY_SSL_PORT/g" \
- -e "s/%proxy_extentions%/${PROXY_EXT//,/|}/g" \
- -e "s/%domain_idn%/$domain_idn/g" \
- -e "s/%domain%/$domain/g" \
- -e "s/%user%/$user/g" \
- -e "s/%group%/$group/g" \
- -e "s/%home%/${HOMEDIR////\/}/g" \
- -e "s/%docroot%/${docroot////\/}/g" \
- -e "s/%sdocroot%/${sdocroot////\/}/g" \
- -e "s/%email%/$email/g" \
- -e "s/%alias_string%/$alias_string/g" \
- -e "s/%alias_idn%/${aliases_idn//,/ }/g" \
- -e "s/%alias%/${aliases//,/ }/g" \
- -e "s/%ssl_crt%/${ssl_crt////\/}/g" \
- -e "s/%ssl_key%/${ssl_key////\/}/g" \
- -e "s/%ssl_pem%/${ssl_pem////\/}/g" \
- -e "s/%ssl_ca_str%/${ssl_ca_str////\/}/g" \
- -e "s/%ssl_ca%/${ssl_ca////\/}/g" \
+ sed -e "s#%ip%#$ip#g" \
+ -e "s#%web_system%#$WEB_SYSTEM#g" \
+ -e "s#%web_port%#$WEB_PORT#g" \
+ -e "s#%web_ssl_port%#$WEB_SSL_PORT#g" \
+ -e "s#%rgroups%#$WEB_RGROUPS#g" \
+ -e "s#%proxy_system%#$PROXY_SYSTEM#g" \
+ -e "s#%proxy_port%#$PROXY_PORT#g" \
+ -e "s#%proxy_ssl_port%#$PROXY_SSL_PORT#g" \
+ -e "s#%proxy_extentions%#${PROXY_EXT//,/|}#g" \
+ -e "s#%domain_idn%#$domain_idn#g" \
+ -e "s#%domain%#$domain#g" \
+ -e "s#%user%#$user#g" \
+ -e "s#%group%#$group#g" \
+ -e "s#%home%#${HOMEDIR////\/}#g" \
+ -e "s#%docroot%#${docroot////\/}#g" \
+ -e "s#%sdocroot%#${sdocroot////\/}#g" \
+ -e "s#%email%#$email#g" \
+ -e "s#%alias_string%#$alias_string#g" \
+ -e "s#%alias_idn%#${aliases_idn//,/ }#g" \
+ -e "s#%alias%#${aliases//,/ }#g" \
+ -e "s#%ssl_crt%#${ssl_crt////\/}#g" \
+ -e "s#%ssl_key%#${ssl_key////\/}#g" \
+ -e "s#%ssl_pem%#${ssl_pem////\/}#g" \
+ -e "s#%ssl_ca_str%#${ssl_ca_str////\/}#g" \
+ -e "s#%ssl_ca%#${ssl_ca////\/}#g" \
>> $conf
}
Code: Select all
+ cat /usr/local/vesta/data/templates/web/awstats/awstats.tpl
+ sed -e s/%ip%/203.25.132.5/g -e s/%web_port%/8080/g -e s/%web_ssl_port%/8443/g -e s/%proxy_port%/80/g -e s/%proxy_ssl_port%/443/g -e s/%domain_idn%/motd.com/g -e s/%domain%/motd.com/g -e s/%user%/admin/g -e s/%home%//home/g -e s/%alias%/1/g -e s/%alias_idn%/www.motd.com/g
sed: -e expression #9, char 11: unknown option to `s'