-
Notifications
You must be signed in to change notification settings - Fork 1
/
motd
executable file
·32 lines (27 loc) · 1.05 KB
/
motd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env bash
# Copyright (C) 2021 Rodrigo Silva (MestreLion) <[email protected]>
# License: GPLv3 or later. See <http://www.gnu.org/licenses/gpl.html>
# -----------------------------------------------------------------------------
DESCRIPTION='Add screenfetch to MOTD (Message of The Day) login "banner"'
ARGS=''
setuplib=${SETUP_LIB_PATH:-"$(dirname "$(readlink -f "$0")")"/../setuplib}
# shellcheck source=../setuplib
if [[ -r "$setuplib" ]]; then source "$setuplib"; else
echo "Setup library not found: $setuplib" >&2; exit 1;
fi
# -----------------------------------------------------------------------------
install_package screenfetch
message 'Enhance MOTD (Message of The Day)'
conf=/etc/update-motd.d/05-"$SETUP_SLUG"-header
setup_run sudo tee "$conf" <<-EOF
#!/bin/sh
# By ${SETUP_NAME}
# A nice ASCII sysinfo for MOTD
# https://github.com/KittyKatt/screenFetch
# Alternative: neofetch
echo
screenfetch
EOF
setup_run sudo chmod +x "$conf"
# Speaking of MOTD...
try setup_run sudo sed -i '/^echo$/s/^/#/' /etc/update-motd.d/97-overlayroot