wip
This commit is contained in:
@@ -32,14 +32,16 @@ if [ "$(md5sum /usr/comma/bg.jpg | awk '{print $1}')" != "$(md5sum /data/openpil
|
||||
# Check if the file contains the line before which we want to insert our line.
|
||||
if grep -qF -- "$INSERT_BEFORE" "$FILE_PATH"; then
|
||||
# Use awk to insert the line before the specified pattern.
|
||||
cp /usr/comma/comma.sh /tmp/comma.sh
|
||||
awk -v insert_line="$SEARCH_STRING" -v before_line="$INSERT_BEFORE" \
|
||||
'BEGIN{found=0}
|
||||
$0 ~ before_line && found == 0 {print insert_line; found=1}
|
||||
{print}' "$FILE_PATH" > "$FILE_PATH.tmp" && mv "$FILE_PATH.tmp" "$FILE_PATH"
|
||||
'BEGIN{found=0}
|
||||
$0 ~ before_line && found == 0 {print insert_line; found=1}
|
||||
{print}' "/tmp/comma.sh" > "/tmp/comma.sh.tmp" && sudo mv "/tmp/comma.sh.tmp" "$FILE_PATH"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
echo Applied custom logo for comma boot sequence
|
||||
sudo sync
|
||||
sleep 2
|
||||
sudo reboot
|
||||
|
||||
Reference in New Issue
Block a user