-
Notifications
You must be signed in to change notification settings - Fork 86
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
Repo Check for Multiverse #26
Conversation
Cleanup and organization of code a bit.
# Check if we were effectively run as root | ||
[ $EUID = 0 ] || { echo "This script needs to be run as root!"; exit 1; } | ||
|
||
#Check for 1GB Memory | ||
totalk=$(awk '/^MemTotal:/{print $2}' /proc/meminfo) | ||
if [ "$totalk" -lt "1000000" ]; then echo "XOCE Requires at least 1GB Memory!"; exit 1; fi | ||
|
||
# Repository add - confirm required repoistor(ies) are enabled and active, update and upgrade no matter what | ||
multiverse="http://archive.ubuntu.com/multiverse" |
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.
I think this line needs revised as grep is failing even if the repo already exists
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.
This will also fail for any Debian install.
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.
It worked on the 18.04.1-live Ubuntu I tested earlier, do you have any recommendations? As for Debian, adding the repository shouldn't be, completed, I agree but I'm not sure how to go about checking what distro we're on and then calling the specific function.
I suppose we could check the /etc/*-release file with cat and pull a string from there to then pipe into an if statement.
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.
If by "worked" you mean "added the repo", then yes it worked. However, it will continue to do so each time you run that section of code because the grep command will always fail.
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.
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.
There can be multiple lines that need multiverse, from the link you posted and one I found the variable adds it to multiple lines within the sources.list file.
It works, but I kind of think it's a bad work around in general.
Checking for dependencies I think would be the best approach, and stop if not found. On the other hand, single line install has always been a big feature of the installation script. (which really should only need to be run once)
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.
With that said of course. . . Ubuntu going and screwing the pooch on this and using a mini iso for their default download adds this complexity that didn't exist until 18.04.1-live on their website.
The issue doesn't exist on other ISO's from what people were saying. I'd have to do more testing to confirm.
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.
Pretty easy to check which distro, then only add multiverse if it's Ubuntu. I submitted a PR.
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.
That would be fine, but we also need to check if multiverse is included or not already, we don't want to add something to sources.list that already exists.
And then the issue goes to what was an offline conversation do we simply want to check for minimum requirements and simply abort the install if the requirements aren't met.
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.
It doesn't actually add it again. If it already exists it just echoes "'multiverse' distribution component is already enabled for all sources."
Closing as @bnrstnr created a workable option. |
Works on Ubuntu 18.04.1-live, will test against Debain 9 and an Alternative download (full) from Ubuntu's website.
Testing welcome.