Skip to content

Conversation

@kawaiipantsu
Copy link
Contributor

updateip.sh breaking on Debian OS installs where multiple partitions are present

Make sure to target root partition, Debian will often come with /boot/efi or similar. This little hack will utilize regular expression to match line starting with / but having a blank after. So only root partition should match.

Example:

# lsblk -o MOUNTPOINT,UUID
MOUNTPOINT UUID

/          xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

/boot/efi  7034-6125


# echo "TEST_BEFORE=$(lsblk -o MOUNTPOINT,UUID | grep -e "/" | awk '{ print $2 }')"
TEST=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
7034-6125

# echo "TEST_FIXED=$(lsblk -o MOUNTPOINT,UUID | grep -e "^/ " | awk '{ print $2 }')"
TEST=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

Where i'm guessing the last outcome is the desired outcome. I think this change will help you in the long run to be more compatible with systems that have multiple partitions.

Make sure to target root partition, Debian will often come with /boot/efi or similar. This little hack will utilize regular expression to match line starting with / but having a blank after. So only root partition should match.
Copy link
Member

@t3chn0m4g3 t3chn0m4g3 left a comment

Choose a reason for hiding this comment

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

LGTM

@t3chn0m4g3
Copy link
Member

Thank you!

@t3chn0m4g3 t3chn0m4g3 merged commit 44c38d8 into telekom-security:master Feb 10, 2023
@kawaiipantsu
Copy link
Contributor Author

Thank you!

Your welcome, I'm from a telco/isp in DK so only natural to help out now you created these solutions to the public.

@kanowah kanowah mentioned this pull request Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants