Skip to content

Commit

Permalink
Only run power button migration if it hasn't already run
Browse files Browse the repository at this point in the history
  • Loading branch information
lukechilds committed Jun 17, 2023
1 parent 5a140a8 commit 3e39d37
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/update/index.js
Expand Up @@ -34,6 +34,10 @@ managed=false
async function activatePowerButtonRecovery({updateRoot}) {
console.log('Activating power button recovery...')

if (await fse.pathExists('/etc/systemd/logind.conf.d/power-button.conf')) {
return console.log(`Skipping because migration has already run`)
}

console.log('Registering acpi event handlers...')
await copyFromOverlay({updateRoot, path: '/etc/acpi/events/power-button'})
await copyFromOverlay({updateRoot, path: '/etc/acpi/power-button.sh'})
Expand Down

0 comments on commit 3e39d37

Please sign in to comment.