Add option for systemd unit naming#1882
Open
TehPeGaSuS wants to merge 4 commits intoeggheads:developfrom
Open
Conversation
Added a way to specify the systemd unit name to avoid accidental overwriting of existing systemd units
thommey
reviewed
Mar 15, 2026
| # Prompt for custom unit name | ||
| puts -nonewline "Enter systemd unit name (without .service) \[default: ${botnet-nick}\]: " | ||
| flush stdout | ||
| set input [string trim [gets stdin]] |
Member
There was a problem hiding this comment.
Please add some validation to this, otherwise you allow path traversal (by specifying "../../../"), e.g. a regex enforcing it to be [a-zA-Z0-9_-], I think systemd has restriction on unit names as well
| ### systemd stuff | ||
| if {$systemd} { | ||
| # Prompt for custom unit name | ||
| puts -nonewline "Enter systemd unit name (without .service) \[default: ${botnet-nick}\]: " |
Member
There was a problem hiding this comment.
Suggestion: Allow specifying the unit name as a commandline option instead of prompting the user interactively (you can still prompt if not specified of course, this would just be an additional option to skip the interactive prompt)
| puts $fd "" | ||
| puts $fd "\[Unit\]" | ||
| puts $fd "Description=${botnet-nick} (Eggdrop)" | ||
| puts $fd "Description=${unitname} (Eggdrop)" |
Member
There was a problem hiding this comment.
I would probably keep the botnet-nick in there as well, just to be more informative, in addition to the unitname
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Found by: PeGaSuS
Patch by: PeGaSuS
Fixes:
One-line summary:
Added a way to specify the systemd unit name to avoid accidental overwriting of existing systemd units
Additional description (if needed):
Test cases demonstrating functionality (if applicable):