Skip to content
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

Fix missing webmin install automation flags #1353

Merged
merged 1 commit into from
Nov 17, 2023

Conversation

benjamink
Copy link
Collaborator

Adding a couple flags to automatically run commands without prompting for the Webmin easyinstall.sh setup. These additions keep the script from prompting the user to continue:

  • Add a -f to the setup-repos.sh script that adds the Webmin package repo
  • Add an --assume-yes for installing the webmin package

@@ -967,9 +967,9 @@ function installWebmin() {
echo "Installing packages..."
sudo apt-get install curl libcgi-session-perl --no-install-recommends --assume-yes </dev/null
curl -o setup-repos.sh https://raw.githubusercontent.com/webmin/webmin/master/setup-repos.sh
sudo sh setup-repos.sh
sudo sh setup-repos.sh -f
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if it's worth also doing </dev/null here to pass an empty input stream to the script and avoid other unexpected prompts? (Due to current or future bugs in a script that's out of our control)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not exactly sure what that does. Does that just ensure there aren't any stray characters/commands that get accidentally processed as key clicks when the script runs?

Copy link
Member

Choose a reason for hiding this comment

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

It establishes an empty stdin stream…. So if the script stops and waits for stdin it will get an empty input and process that accordingly. The actual effect will depend on the script. We could test what happens if the repo hasn’t been added and -f not passed!

Copy link
Member

Choose a reason for hiding this comment

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

Upon second thought, this is probably a bad idea. :)

If the behavior of the Webmin bootstrap script changes and starts prompting for something new, we probably want to expose that to users.

The </dev/null input stream workaround is more for tools like apt-get which aren’t guaranteed to always behave when running non-interactively — https://stackoverflow.com/questions/54736013/why-does-apt-get-consume-stdin-when-it-installs-something-but-not-otherwise

@benjamink benjamink merged commit 984a2e1 into PiSCSI:develop Nov 17, 2023
3 checks passed
@benjamink benjamink deleted the webmin-install-fixes branch November 17, 2023 10:53
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