Skip to content

Fix missing webmin install automation flags#1353

Merged
benjamink merged 1 commit intoPiSCSI:developfrom
benjamink:webmin-install-fixes
Nov 17, 2023
Merged

Fix missing webmin install automation flags#1353
benjamink merged 1 commit intoPiSCSI:developfrom
benjamink:webmin-install-fixes

Conversation

@benjamink
Copy link
Copy Markdown
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

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
@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