-
-
Notifications
You must be signed in to change notification settings - Fork 304
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Tobias Knöppler <[email protected]> Signed-off-by: nachoparker <[email protected]>
- Loading branch information
1 parent
3af0c46
commit 4a99207
Showing
2 changed files
with
15 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,8 +8,6 @@ | |
# More at: https://ownyourbits.com | ||
# | ||
|
||
|
||
|
||
configure() | ||
{ | ||
# update password | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -150,6 +150,7 @@ function run_app_unsafe() | |
|
||
echo "" >> $log | ||
|
||
clear_password_fields "$cfg_file" | ||
return "$ret" | ||
} | ||
|
||
|
@@ -278,6 +279,20 @@ function check_distro() | |
return 1 | ||
} | ||
|
||
function clear_password_fields() | ||
{ | ||
local cfg_file="$1" | ||
local cfg="$(cat "$cfg_file")" | ||
local len="$(jq '.params | length' <<<"$cfg")" | ||
for (( i = 0 ; i < len ; i++ )); do | ||
local type="$(jq -r ".params[$i].type" <<<"$cfg")" | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
nachoparker
Member
|
||
local val="$( jq -r ".params[$i].value" <<<"$cfg")" | ||
[[ "$type" == "password" ]] && val="" | ||
cfg="$(jq -r ".params[$i].value=\"$val\"" <<<"$cfg")" | ||
done | ||
echo "$cfg" > "$cfg_file" | ||
} | ||
|
||
function apt_install() | ||
{ | ||
apt-get update | ||
|
Out of interest: Why didn't you go with my approach (using jq for field filtering) and instead implemented it yourself?