Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
alpine-conf
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
18
Issues
18
List
Boards
Labels
Service Desk
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alpine
alpine-conf
Commits
7ba8c4c2
Commit
7ba8c4c2
authored
Aug 19, 2009
by
Natanael Copa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libalpine: imported some funcs from openbsd installer
parent
8bee519d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
0 deletions
+37
-0
libalpine.sh.in
libalpine.sh.in
+37
-0
No files found.
libalpine.sh.in
View file @
7ba8c4c2
...
...
@@ -76,3 +76,40 @@ invalid_ip() {
cfg_add() {
[ -z "
$NOCOMMIT
" ] && lbu_add "
$@
"
}
# from OpenBSD installer
# Ask for a password, saving the input in
$resp
.
# Display
$1
as the prompt.
# *Don't* allow the '!' options that ask does.
# *Don't* echo input.
# *Don't* interpret "
\"
as escape character.
askpass
()
{
echo
-n
"
$1
"
set
-o
noglob
stty
-echo
read
-r
resp
stty echo
set
+o noglob
echo
}
# Ask for a password twice, saving the input in $_password
askpassword
()
{
local
_oifs
=
$IFS
IFS
=
while
:
;
do
askpass
"Password for
$1
account? (will not echo)"
_password
=
$resp
askpass
"Password for
$1
account? (again)"
# N.B.: Need quotes around $resp and $_password to preserve leading
# or trailing spaces.
[
"
$resp
"
=
"
$_password
"
]
&&
break
echo
"Passwords do not match, try again."
done
IFS
=
$_oifs
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment