mirror of
https://gitlab.com/hacklab01/pivilion.git
synced 2026-08-06 16:08:22 +00:00
Move MOTD into TTY login banner
This commit is contained in:
parent
ed0b168ab6
commit
bbbf80c25f
11 changed files with 137 additions and 29 deletions
10
tests/run.sh
10
tests/run.sh
|
|
@ -49,6 +49,15 @@ state_contract() {
|
|||
grep -q 'degraded' "$ROOT/usr/local/lib/pivilion/mode.sh"
|
||||
}
|
||||
|
||||
tty_banner_contract() {
|
||||
grep -q 'StandardOutput=null' "$ROOT/etc/systemd/system/pivilion-login-banner.service" &&
|
||||
! grep -q 'journal+console' "$ROOT/etc/systemd/system/pivilion-login-banner.service" &&
|
||||
grep -q '/etc/issue.d/90-pivilion.issue' "$ROOT/usr/local/lib/pivilion/issue-banner.sh" &&
|
||||
grep -q 'SSH_CONNECTION' "$ROOT/etc/profile.d/pivilion-motd.sh" &&
|
||||
grep -q 'agetty --reload' "$ROOT/usr/local/lib/pivilion/mode.sh" &&
|
||||
! grep -Eq '(^|[[:space:]])/etc/issue([[:space:]]|$)' "$ROOT/install.sh"
|
||||
}
|
||||
|
||||
shellcheck_scripts() {
|
||||
command -v shellcheck >/dev/null 2>&1 || return 0
|
||||
shellcheck "$ROOT/install.sh" "$ROOT"/usr/local/lib/pivilion/*.sh "$ROOT"/usr/local/bin/pivilion* "$ROOT/usr/local/bin/hotspot" "$ROOT/usr/local/bin/onion" "$ROOT/usr/local/bin/pikey"
|
||||
|
|
@ -61,6 +70,7 @@ run "systemd unit syntax" systemd_syntax
|
|||
run "temporary HTTP-only captive rules" captive_rules
|
||||
run "transactional installer safety contract" installer_safety
|
||||
run "truthful runtime state contract" state_contract
|
||||
run "agetty login-banner contract" tty_banner_contract
|
||||
run "ShellCheck (when installed)" shellcheck_scripts
|
||||
|
||||
[ "$failures" -eq 0 ] || { echo "$failures test group(s) failed." >&2; exit 1; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue