-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #11153: sysconfig/apache2 modifications get removed #1509
Fixes #11153: sysconfig/apache2 modifications get removed #1509
Conversation
if ! grep -qE "^. /etc/sysconfig/rudder-relay-apache$" /etc/sysconfig/apache2; then | ||
nextline=$(grep -A1 -E "^. /etc/sysconfig/rudder-relay-apache$" /etc/sysconfig/apache2 | tail -n1) | ||
if [ "${nextline}" = "" ]; then | ||
# No include currently | ||
echo -e '# This sources the modules/defines needed by Rudder\n. /etc/sysconfig/rudder-relay-apache' >> /etc/sysconfig/apache2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don' we do 2 lines instead of one for each echo ? this makes it completely unreadable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
echo -e '# This sources the modules/defines needed by Rudder' >> /etc/sysconfig/apache2
echo -e '. /etc/sysconfig/rudder-relay-apache' >> /etc/sysconfig/apache2
instead of
echo -e '# This sources the modules/defines needed by Rudder\n. /etc/sysconfig/rudder-relay-apache' >> /etc/sysconfig/apache2
echo -e '# This line is necessary for fillup not to remove any lines above. See #11153\nAPACHE_RUDDER_RELAY_CUSTOMIZED="true"' >> /etc/sysconfig/apache2 | ||
elif [ "${nextline}" != "# This line is necessary for fillup not to remove any lines above. See #11153" ]; then | ||
# Old include without comment | ||
sed -i 's|. /etc/sysconfig/rudder-relay-apache|. /etc/sysconfig/rudder-relay-apache\n# This line is necessary for fillup not to remove any lines above. See #11153\nAPACHE_RUDDER_RELAY_CUSTOMIZED="true"|' /etc/sysconfig/apache2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whye not the same echo as above ? and a complex sed ... because you need to have the line just below ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, we want to insert the line just after the Rudder include.and keep a consistent file across versions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok!
89683f6
to
3f0b905
Compare
PR rebased |
OK, merging this PR |
https://www.rudder-project.org/redmine/issues/11153