Files
agent-mkosi/mkosi.extra/usr/libexec/agent-boot
T
Job79andClaude Opus 5.5 a1fc65ed21 style: apply STYLE.md to all files
Give every file a header (title, empty line, explanation), wrap comments
at 80 columns and keep them to the why. Only comments change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 20:14:06 +01:00

13 lines
574 B
Bash
Executable File

#!/bin/bash
# Apply setup
#
# Runs at every boot (agent-boot.service) and right after the setup. /etc is
# read-only, so the hostname asked at setup is set again on every boot. Makes
# the ssh host key the first time. Wipes Claude's config except its login, so
# Claude starts fresh but logged in.
set -euo pipefail
cd /var/lib/agent
hostnamectl hostname --transient "$(cat hostname)"
[[ -f ssh_host_ed25519_key ]] || ssh-keygen -q -t ed25519 -N '' -f ssh_host_ed25519_key
find claude -mindepth 1 -maxdepth 1 ! -name .credentials.json ! -name .claude.json -exec rm -rf {} +