Project

General

Profile

« Previous | Next » 

Revision 336

Makefile: Use --loose-exit-status for ed to avoid failing on no match. In editPhppgadminApacheConf, use ,s/// instead of /.../\ns/// to match lines regardless of position.

View differences:

Makefile
71 71
	@$(wait)
72 72

  
73 73
editPhppgadminApacheConf =\
74
echo $$'1\n/^allow from 127\.0\.0\.0\b/\ns/^/\# /\n/\# allow from all/\ns/^\# //\nwq'|\
75
sudo ed --verbose /etc/phppgadmin/apache.conf
74
echo $$'1\n,s/^allow from 127\.0\.0\.0\\b/\# &/\n,s/\# \(allow from all\)/\1/\nwq'|\
75
sudo ed --loose-exit-status --verbose /etc/phppgadmin/apache.conf
76 76

  
77 77
apacheConf := /etc/apache2/apache2.conf
78 78
apacheConfPhppgadminLine := Include /etc/phppgadmin/apache.conf
......
81 81
$(call sudoAppend,$(apacheConf),\n$(apacheConfPhppgadminLine)))
82 82

  
83 83
nonApacheOnPort80 = $(shell sudo lsof -i :80|tail -n +2|grep -v -F apache2)
84
editApachePortsConf =\
85
echo $$'1\n,s/\\b80\\b/8080/g\nwq'|sudo ed --verbose /etc/apache2/ports.conf
84
editApachePortsConf = echo $$'1\n,s/\\b80\\b/8080/g\nwq'|\
85
sudo ed --loose-exit-status --verbose /etc/apache2/ports.conf
86 86

  
87 87
postgres-Linux: _not_file
88 88
	-sudo apt-get install postgresql libpq-dev phppgadmin
89
	-$(editPhppgadminApacheConf)
89
	$(editPhppgadminApacheConf)
90 90
	$(editApacheConfForPhppgadmin)
91
	-$(if $(nonApacheOnPort80),$(editApachePortsConf))
91
	$(if $(nonApacheOnPort80),$(editApachePortsConf))
92 92
	-sudo apache2ctl restart
93 93
	-sudo pip install psycopg2
94 94
# ignore errors if conf files already edited

Also available in: Unified diff