forked from MiczFlor/RPi-Jukebox-RFID
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Installation fixes and refactoring (MiczFlor#2350)
* fix: added vars into logfile * refactor: split finish_installation routine extracted rfid_reader setup * refactor: removed "Replace homedir" code in installation v2 will not be refactored to be used with a different user * fix: add escaping for all vars written to PhonieboxInstall.conf * refactor: change and unify sed delimiter to pipe char * fix: add escaping for sed replacements * refactor: moved network setup into install_main * refactor: introduce helper script, moved functions * fix: add escaping for autohotspot * fix: command for special char handling * fix: update testdata for special chars
- Loading branch information
1 parent
d76a7ef
commit 4626e5d
Showing
10 changed files
with
221 additions
and
216 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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Reads a textfile and pipes all lines as args to the given command. | ||
# Does filter out comments. | ||
# Arguments: | ||
# 1 : textfile to read | ||
# 2... : command to receive args (e.g. 'echo', 'apt-get -y install', ...) | ||
call_with_args_from_file () { | ||
local package_file="$1" | ||
shift | ||
|
||
sed 's|#.*||g' ${package_file} | xargs "$@" | ||
} | ||
|
||
# escape relevant chars for strings used in 'sed' commands. implies delimiter char '|' | ||
escape_for_sed() { | ||
local escaped=$(echo "$1" | sed -e 's/[\&'\''|]/\\&/g') | ||
echo "$escaped" | ||
} |
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
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
Oops, something went wrong.