Skip to content

Commit

Permalink
Fix to use single quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
iliajie committed Jun 6, 2022
1 parent da0a49e commit d5c18a8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions virtualmin-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,7 @@ install_virtualmin_release() {
# be replaced upon replease package upgrade
if [ -x "/usr/bin/rpm" ]; then
rpm_release_files="$(rpm -qal virtualmin*release)"
rpm_release_files=$(echo "$rpm_release_files" | tr "\n" " ")
rpm_release_files=$(echo "$rpm_release_files" | tr '\n' ' ')
if [ -n "$rpm_release_files" ]; then
for rpm_release_file in $rpm_release_files; do
rm -f "$rpm_release_file"
Expand All @@ -819,7 +819,7 @@ install_virtualmin_release() {
# Fix login credentials if fixing repos
if [ -n "$setup_only" ]; then
sed -i "s/SERIALNUMBER:LICENSEKEY@/$LOGIN/" /etc/yum.repos.d/virtualmin.repo
sed -i "s/http:\/\//https:\/\//" /etc/yum.repos.d/virtualmin.repo
sed -i 's/http:\/\//https:\/\//' /etc/yum.repos.d/virtualmin.repo
fi
;;
debian | ubuntu)
Expand Down

2 comments on commit d5c18a8

@swelljoe
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still think using a different separator in sed is easier to read, as I suggested here (single quotes also fine, doesn't matter if you don't have to escape anything): #70 (comment)

@iliajie
Copy link
Contributor Author

@iliajie iliajie commented on d5c18a8 Jun 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your suggestion, Joe. I will consider that in the future.

This is really cool in-fact, that sed can use any other character as a delimiter, whichever character comes after the s.

Please sign in to comment.