Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kx1t committed Nov 19, 2023
1 parent 86fca8b commit 7108990
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rootfs/etc/s6-overlay/scripts/30-set-direwolf-params
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,15 @@ function setdwconfig() {
"${s6wrap[@]}" echo "[INFO] Uncommenting (if it exists): ${param:10} ${value}"

elif [[ "${param:0:4}" == "add:" ]]; then
echo -n "${param:4}${value:+ }${value}" >> "$DWCONFIGFILE"
echo "${param:4}${value:+ }${value}" >> "$DWCONFIGFILE"
"${s6wrap[@]}" echo "[INFO] Adding: ${param:4} ${value}"

else
if grep -qo "^\s*#*\s*${param}\b.*$" "$DWCONFIGFILE"; then
sed -i "s|^\s*#*\s*${param}\b.*$|${param} ${value}|g" "$DWCONFIGFILE"
"${s6wrap[@]}" echo "[INFO] Replacing: ${param} ${value}"
else
echo -n "${param} ${value}" >> "$DWCONFIGFILE"
echo "${param} ${value}" >> "$DWCONFIGFILE"
"${s6wrap[@]}" echo "[INFO] Adding: ${param} ${value}"
fi
fi
Expand Down

0 comments on commit 7108990

Please sign in to comment.