This commit is contained in:
Your Name
2024-02-13 04:20:54 -06:00
parent 05c45829f8
commit dc1ee37053
3 changed files with 42 additions and 58 deletions

View File

@@ -32,8 +32,8 @@ 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" \
sudo cp /usr/comma/comma.sh /tmp/comma.sh
sudo 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}' "/tmp/comma.sh" > "/tmp/comma.sh.tmp" && sudo mv "/tmp/comma.sh.tmp" "$FILE_PATH"
@@ -44,5 +44,6 @@ if [ "$(md5sum /usr/comma/bg.jpg | awk '{print $1}')" != "$(md5sum /data/openpil
echo Applied custom logo for comma boot sequence
sudo sync
sleep 2
sudo reboot
sudo mount -o remount,ro /
sudo sync
fi