You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by ru...@apache.org on 2020/11/15 20:29:25 UTC
[whimsy] branch master updated: update passenger.conf when --user
is toggled
This is an automated email from the ASF dual-hosted git repository.
rubys pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git
The following commit(s) were added to refs/heads/master by this push:
new 7d59daf update passenger.conf when --user is toggled
7d59daf is described below
commit 7d59daf9e3810c451dde1e455702dc044acaee87
Author: Sam Ruby <ru...@intertwingly.net>
AuthorDate: Sun Nov 15 15:28:45 2020 -0500
update passenger.conf when --user is toggled
---
config/setupmymac | 36 ++++++++++++++++++------------------
1 file changed, 18 insertions(+), 18 deletions(-)
diff --git a/config/setupmymac b/config/setupmymac
index 2bab58c..2b1686d 100755
--- a/config/setupmymac
+++ b/config/setupmymac
@@ -356,27 +356,27 @@ end
### Configure passenger
passenger_conf = '/etc/apache2/other/passenger.conf'
-if force[:passenger] or not File.exist? passenger_conf
- if Process.uid == 0
- instructions = `su $SUDO_USER -c "brew info passenger"`
- else
- instructions = `brew info passenger`
- end
- section = instructions[/To activate Phusion Passenger for Apache.*(\n\n|\z)/m]
- snippet = section.scan(/^ .*/).join("\n") + "\n"
- snippet[/Passenger\w*Ruby\s+(.*)/, 1] = RbConfig.ruby
- if option != :user
- snippet += "PassengerUser #{user}\nPassengerGroup #{group}\n"
- end
+if Process.uid == 0
+ instructions = `su $SUDO_USER -c "brew info passenger"`
+else
+ instructions = `brew info passenger`
+end
- if not File.exists?(passenger_conf) or File.read(passenger_conf) != snippet
- sudo do
- color "$ sudo edit #{passenger_conf}"
- File.write passenger_conf, snippet unless $dry_run
+section = instructions[/To activate Phusion Passenger for Apache.*(\n\n|\z)/m]
+snippet = section.scan(/^ .*/).join("\n") + "\n"
+snippet[/Passenger\w*Ruby\s+(.*)/, 1] = RbConfig.ruby
- restart_apache = true
- end
+if option != :user
+ snippet += "PassengerUser #{user}\nPassengerGroup #{group}\n"
+end
+
+if not File.exists?(passenger_conf) or File.read(passenger_conf) != snippet
+ sudo do
+ color "$ sudo edit #{passenger_conf}"
+ File.write passenger_conf, snippet unless $dry_run
+
+ restart_apache = true
end
end