18 lines
353 B
Bash
Executable File
18 lines
353 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Run this script with "bash <filename>".
|
|
|
|
# Exit on error.
|
|
set -e
|
|
|
|
FILE='/etc/motd'
|
|
DISABLED_EXT='disabled'
|
|
|
|
if [ -f "${FILE:-/tmp/none}.${DISABLED_EXT:-/oops}" ]; then
|
|
mv -v "${FILE:-/tmp/none}.${DISABLED_EXT:-/oops}" \
|
|
"${FILE:-/tmp/none}"
|
|
else
|
|
mv -v "${FILE:-/tmp/none}" \
|
|
"${FILE:-/tmp/none}.${DISABLED_EXT:-/oops}"
|
|
fi
|