Skip to content

Commit

Permalink
Fix motd generator script
Browse files Browse the repository at this point in the history
  • Loading branch information
dappnodedev committed May 29, 2024
1 parent c3aa01c commit 0cc43a3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scripts/dappnode_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -218,13 +218,13 @@ EOF
generateMotdScript() {

motd_script_file="${UPDATE_MOTD_DIR}/60-dappnode-info"
disabled_motd_dir="/etc/update-motd.d/disabled"
disabled_motd_dir="${UPDATE_MOTD_DIR}/disabled"

mkdir -p "${disabled_motd_dir}"

# Move all the files in /etc/update-motd.d/ to /etc/update-motd.d/disabled/
# Except for the files listed in "files_to_keep"
files_to_keep="00-header 50-landscape-sysinfo 90-updates-available 98-reboot-required"
files_to_keep="00-header 50-landscape-sysinfo 98-reboot-required"
for file in ${UPDATE_MOTD_DIR}/*; do
base_file=$(basename "${file}")
if [ -f "${file}" ] && ! echo "${files_to_keep}" | grep -qw "${base_file}"; then
Expand All @@ -238,8 +238,8 @@ generateMotdScript() {

chmod +x "${motd_script_file}"

sh -c 'echo "#!/bin/sh" > ${motd_script_file}'
echo "cat ${MOTD_FILE}" >>"${motd_script_file}"
echo "#!/bin/sh" >${motd_script_file}
echo "cat ${MOTD_FILE}" >>${motd_script_file}
}

addSwap() {
Expand Down

0 comments on commit 0cc43a3

Please sign in to comment.