diff options
author | Markus Uhlin <markus@nifty-networks.net> | 2023-12-20 23:19:27 +0100 |
---|---|---|
committer | Markus Uhlin <markus@nifty-networks.net> | 2023-12-20 23:19:27 +0100 |
commit | d448e8bb3d784fb4fefa92fc2d91f68a9ec8c0d6 (patch) | |
tree | c84a996860c7f158048d09d0252c06ad0e6b5e88 /scripts | |
parent | 85fc3e52c3ae5348b98750a45d7f70a69b83d2e8 (diff) |
i-data-messages.sh -- initial revision
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/i-data-messages.sh | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/scripts/i-data-messages.sh b/scripts/i-data-messages.sh new file mode 100755 index 0000000..4e71783 --- /dev/null +++ b/scripts/i-data-messages.sh @@ -0,0 +1,40 @@ +#!/bin/sh +# SPDX-FileCopyrightText: 2023 Markus Uhlin <maxxe@rpblc.net> +# SPDX-License-Identifier: ISC + +i_data_messages () { + local _src_prefix _dest _files + + _src_prefix=${1} + _dest=${2} + +# welcome.backup +# welcome.old + _files=" +admotd +login +logout +logout.fancy +motd +unregistered +welcome +" + + echo "installing..." + + for file in ${_files}; do + printf "%s -> %s: " "${_src_prefix}/${file}" "${_dest}/${file}" + if [ -r "${_src_prefix}/${file}" ]; then + install -m 0644 "${_src_prefix}/${file}" "${_dest}" + if [ $? -eq 0 ]; then + echo "ok" + else + echo "error" + fi + else + echo "not found" + fi + done +} + +i_data_messages "${1}" "${2}" |