Extract Tarball on boot (#127)

* reworking logic to untar on first boot and reducing sample size for chown logic as it is not recursive

* bad path in arm variants
This commit is contained in:
Ryan Kuba
2019-03-29 05:53:57 +08:00
committed by saarg
parent d052b13f92
commit 0f9f1ef4d3
4 changed files with 14 additions and 27 deletions

View File

@@ -12,12 +12,17 @@ mkdir -p \
[[ ! -e /config/config ]] && \
(cp /defaults/config /config/config)
# extract picons on first run
[[ -f /picons.tar.bz2 ]] && \
tar xf \
/picons.tar.bz2 -C \
/picons &&
rm -f /picons.tar.bz2
# function to randomly sample 10 files for their owner and only chown if not abc
# function to randomly sample 5 files for their owner and only chown if not abc
chowner () {
files=(${1}/*)
for i in {1..10}; do
for i in {1..5}; do
user=$(stat -c '%U' $(printf "%s\n" "${files[RANDOM % ${#files[@]}]}"))
if [ "${user}" != "abc" ]; then
chown -R abc:abc ${1}