Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions install-root-w3bs-os.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
# The script is fetched from this release's git tag and must match the sha256 below, so
# the signed release installs exactly what was reviewed. Re-run to update.
set -eu
VERSION=0.1.0
SHA256=de06d5cf0fd62d8f9a9d867a1e2a4eb753601ad7eaa2600a5ad7cf8788e54a76
VERSION=0.1.1
SHA256=b0500d02fb9ac589c37733f0d9bb0ef550cf24f44dcf0a984a811dd29923c3d5
URL="https://raw.githubusercontent.com/profullstack/cli-tools/root-w3bs-os-v$VERSION/root-w3bs-os.sh"
fail() { printf 'root-w3bs-os: %s\n' "$*" >&2; exit 1; }
command -v curl >/dev/null 2>&1 || fail 'curl is required'
Expand Down
4 changes: 4 additions & 0 deletions root-ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4693,12 +4693,16 @@ try "networkd-dispatcher" quiet_networkd_dispatcher
# refresh, so a slow/dead endpoint can never hang an ssh login.
install_motd() {
local units_changed=0
# A cache written by an earlier refresher is 0600: "Permission denied" at every login.
[[ -f "$MOTD_CACHE" ]] && chmod 0644 "$MOTD_CACHE"
write_if_changed /usr/local/bin/profullstack-motd 0755 <<EOF && note "motd refresher"
#!/bin/sh
# refresh the cached motd from ${MOTD_URL}
umask 022
tmp="\$(mktemp)" || exit 0
if curl -fsSL --max-time 10 '${MOTD_URL}' -o "\$tmp" && [ -s "\$tmp" ]; then
# mktemp makes the file 0600 whatever the umask; every login shell cats the cache.
chmod 0644 "\$tmp"
mv "\$tmp" '${MOTD_CACHE}'
else
rm -f "\$tmp"
Expand Down
6 changes: 5 additions & 1 deletion root-w3bs-os.sh
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ set -uo pipefail

# The packaged release (w3bs install profullstack.com/root-w3bs-os). Bump with every
# change that ships, and tag the commit root-w3bs-os-v<version>.
ROOT_W3BS_OS_VERSION=0.1.0
ROOT_W3BS_OS_VERSION=0.1.1
case "${1:-}" in
--version|-V) printf 'root-w3bs-os %s\n' "$ROOT_W3BS_OS_VERSION"; exit 0 ;;
esac
Expand Down Expand Up @@ -5104,12 +5104,16 @@ try "fail2ban" configure_fail2ban
# through Alpine's /etc/zsh/zprofile.
install_motd() {
local units_changed=0
# A cache written by an earlier refresher is 0600: "Permission denied" at every login.
[[ -f "$MOTD_CACHE" ]] && chmod 0644 "$MOTD_CACHE"
write_if_changed /usr/local/bin/profullstack-motd 0755 <<EOF && note "motd refresher"
#!/bin/sh
# refresh the cached motd from ${MOTD_URL}
umask 022
tmp="\$(mktemp)" || exit 0
if curl -fsSL --max-time 10 '${MOTD_URL}' -o "\$tmp" && [ -s "\$tmp" ]; then
# mktemp makes the file 0600 whatever the umask; every login shell cats the cache.
chmod 0644 "\$tmp"
mv "\$tmp" '${MOTD_CACHE}'
else
rm -f "\$tmp"
Expand Down
Loading