Ubuntu uses different package names from CentOS mind you.
The trick is to detect the distribution first and then have different sets of commands doing the same thing.
This is actually the way to write multiplatform Ansible roles as well
//EDIT: Example of what I was talking about with Ansible:
ansible-role-nginx/tasks at master · geerlingguy/ansible-role-nginx · GitHub
- include_tasks: setup-RedHat.yml
when: ansible_os_family == 'RedHat'
- include_tasks: setup-Ubuntu.yml
when: ansible_distribution == 'Ubuntu'
- include_tasks: setup-Debian.yml
when: ansible_os_family == 'Debian'
Yeah, which are the edge cases I’m talking about (I was typing the edit as you posted haha). The majority of common packages are generally the same, it wouldn’t be difficult to test it and find any variations.
Though, I would argue that the level that Ansible utilises is probably overkill for this project.
Well, glad I will be learning something along the way. I will have a prototype up in about 15-30 minutes for anyone that is interested to have an early look/test run.
I will have a look at distro/packages recognition in the next couple days. Happy to learn smth along the way
Thanks for all the input guys!
I really like this project!
SkylonHost can provide free test servers for this with both CentOS 7 and Ubuntu 18.04
PM me if you’re interested @Ympker
I have been gifted 50$ of Lunanode credit so I am good atm
But thanks anyway!
Postponed to tomorrow
The script is more or less done but putting it all together I’ll need a few minutes and too tired rn^^
No love for CentOS
CentOS sounds like a Mexican called Santos, who’s begging for coins
Not home until 21:00 but it’ll be published today
So, as said before: Anyone who wishes to get an early look at the script/give it a roll you can now do that:
GitHub - NicolasLoew/Ympkit: Ympker's Multipurpose Serverkit
Haven’t really tested it yet, so if you want to wait for smth stable maybe wait a bit longer
@Wolveix there you go mate!
I’ve submitted a pull request
Nice! I’ve already made another commit, I’ll do some more when I get back from the gym
I need to add a load of distro checks since there aren’t any yet (other than at the beginning of the script).
Aight! Thanks for the contributions
Why printf instead of echo? Noticed you changed that. Google didn’t really say anything except that echo is newline and printf not. But I didn’t consider this a problem.
Printf just adds colour support and a few other cool things. I would argue that it’s better, but others may disagree haha.
Excellent project mate!!!
Hope it can be useful to some people here^^
Edit: Github Link now also is in OP
Alright. I might need to customize this to be the ultimate VPS idler script… toss in some 1 button disk + network benchmarks so I can lock down and bench a new box, haha.
Geekbench and Bench.sh are included already. Any specific one you are looking for?
Feel free to create a pull request on GitHub or request it and I’ll add it when I have time^^
Wasn’t there some nice LET network bench with lots of speedtest locations?
If you’ve got bench.sh already then that’s basically what I was referring to. So I’ve got no work to do, lol.
If I have some time maybe I’ll build an iperf function to install + have a pre-set list of the popular servers to test against or something if you haven’t already built it.
@Wolveix Seems your pull screwed the setup script a bit
root@serverkittest:/home/debian# sh setup.sh
=== Ympkit v0.0.1 ===
setup.sh: 5: setup.sh: Syntax error: word unexpected (expecting “in”)
/usr/bin/env: ‘bash\r’: No such file or directory
Same goes for serverkit.sh
root@serverkittest:~# sh serverkit.sh
: not foundh: 4: serverkit.sh:
serverkit.sh: 6: serverkit.sh: Syntax error: word unexpected (expecting “in”)