Skip to content

Commit

Permalink
Merge pull request #1 from molhamalnasr/change-config.txt-path-for-bo…
Browse files Browse the repository at this point in the history
…okworm

fix the path for the config.txt file
  • Loading branch information
molhamalnasr authored Jan 4, 2025
2 parents 8bd3fc8 + 1570284 commit c9f4954
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions x735-script-pkg/DEBIAN/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -e

readonly LINE_TO_ADD="dtoverlay=pwm-2chan,pin2=13,func2=4"
readonly CONFIG_FILE="/boot/config.txt"
readonly CONFIG_FILE="/boot/firmware/config.txt"
readonly BACKUP_FILE="${CONFIG_FILE}.backup"

readonly PERMISSION_DENIED="151"
Expand All @@ -29,10 +29,10 @@ fi
# Backup the config file
cp -p "${CONFIG_FILE}" "${BACKUP_FILE}"

# Search for the all directive in /boot/config.txt
# Search for the all directive in $CONFIG_FILE
search_directive=$(grep -n '^\[all\]' "${CONFIG_FILE}")

# Create the [all] directive in /boot/config.txt, if it doesn't exist and append the $LINE_TO_ADD to it
# Create the [all] directive in $CONFIG_FILE, if it doesn't exist and append the $LINE_TO_ADD to it
if [[ -z "${search_directive}" ]]; then
echo "[all]" >> "${CONFIG_FILE}"
echo "${LINE_TO_ADD}" >> "${CONFIG_FILE}"
Expand Down

0 comments on commit c9f4954

Please sign in to comment.