Skip to content

Commit

Permalink
Merge pull request #29 from dhruveshb-mecha/dev-kernel-v1
Browse files Browse the repository at this point in the history
fix: append content to existing file
  • Loading branch information
dhruveshb-mecha authored Aug 22, 2024
2 parents 9297c96 + 45aa52a commit 797876b
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions debian/distro/modules/system-config.nu
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,12 @@ export def configure_sys_files [] {
SUDO cp $fstab_src $fstab_dest

let logind_conf_content = "HandlePowerKey=ignore"
let temp_file = "/tmp/logind-conf-content"

echo $logind_conf_content | save --force $temp_file

let logind_conf_dest = $rootfs_dir + "/etc/systemd/logind.conf"
# Check if the content already exists, and if not, append it
SUDO sh -c $"grep -qxF '($logind_conf_content)' ($logind_conf_dest) || echo '($logind_conf_content)' >> ($logind_conf_dest)"

log_debug "Configuring system files completed successfully."

SUDO mv $temp_file $logind_conf_dest

}

Expand Down

0 comments on commit 797876b

Please sign in to comment.