-
-
Notifications
You must be signed in to change notification settings - Fork 15
feature/dialog: feature provides a wrapper around dialogs #40
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
Conversation
|
@wladmis, you might be interested. |
| ! type -P unl0kr >/dev/null || ask=__ask_pass_with_unl0kr | ||
|
|
||
| # To avoid issues with quoting arguments for the utility, a temporary | ||
| # wrapper can be created. |
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.
Too hacky, but OK.
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.
@wladmis What exactly seems like a hack to you?
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.
A workaround with a wrapper file to solve quoting issues, but I don't know better solution.
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.
Well, this is a simple and effective way to do it. If it doesn't happen very often, I don't see anything wrong with it.
| ! type -P unl0kr >/dev/null || ask=__ask_pass_with_unl0kr | ||
|
|
||
| # To avoid issues with quoting arguments for the utility, a temporary | ||
| # wrapper can be created. |
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.
A workaround with a wrapper file to solve quoting issues, but I don't know better solution.
|
|
||
| # To avoid issues with quoting arguments for the utility, a temporary | ||
| # wrapper can be created. | ||
| tempfile="/.initrd/dialog-ask-pass-$$.$BASHPID" |
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 guess it'd be better if the local definition of tempfile was placed right above this line, and if it was named smth like cmdwrapper instead of tempfile.
local cmdwrapper
cmdwrapper="="/.initrd/dialog-ask-pass-$$.$BASHPID"
...
"$ask" "$prompt" "$tries" "$cmdwrapper" || rc="$?"
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.
Yes, it makes sense to rename the temporary file.
This feature provides a wrapper around dialogs such as password prompts. Work with dialogs becomes more challenging when plymouth is used. Other utilities can also be used to display the dialog. Signed-off-by: Alexey Gladkov <gladkov.alexey@gmail.com>
52a068c to
74600c1
Compare
This feature provides a wrapper around dialogs such as password prompts. Work with dialogs becomes more challenging when plymouth is used. Other utilities can also be used to display the dialog.