dash (Debian's /bin/sh) doesn't support echo's -e flag: it prints "-e" literally as text before processing the rest of the string's backslash escapes. Every script's colored banner was affected. printf's escape handling is POSIX-mandated and behaves identically under dash and bash, so swap all 90 echo -e calls for printf, appending the trailing \n that echo used to add implicitly. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
31 lines
1.0 KiB
Bash
Executable File
31 lines
1.0 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
printf '\033[35m
|
|
___ __ __ __ __ __
|
|
/ | __ __/ /_____ / / / /___ ____/ /___ _/ /____
|
|
/ /| |/ / / / __/ __ \ / / / / __ \/ __ / __ `/ __/ _ \
|
|
/ ___ / /_/ / /_/ /_/ / / /_/ / /_/ / /_/ / /_/ / /_/ __/
|
|
/_/ |_\__,_/\__/\____/ \____/ .___/\__,_/\__,_/\__/\___/
|
|
/_/
|
|
\033[0m\n'
|
|
# https://www.howtoforge.com/how-to-configure-automatic-updates-on-debian-wheezy
|
|
# https://www.bisolweb.com/tutoriels/serveur-vps-ovh-partie-5-installation-apticron/
|
|
|
|
if [ "$(id -u)" -ne 0 ]; then
|
|
echo "Please run as root"
|
|
exit
|
|
fi
|
|
|
|
printf "\033[35;1mInstalling apticron \033[0m\n"
|
|
apt-get --yes install apticron
|
|
|
|
sleep 3
|
|
echo -n "Enter an email: "
|
|
read email
|
|
|
|
sed -i -r "s/EMAIL=\"root\"/EMAIL=\"$email\"/g" /etc/apticron/apticron.conf
|
|
# sed -i -r "s/# DIFF_ONLY=\"1\"/DIFF_ONLY=\"1\"/g" /etc/apticron/apticron.conf
|
|
sed -i -r "s/# NOTIFY_NEW=\"0\"/NOTIFY_NEW=\"0\"/g" /etc/apticron/apticron.conf
|
|
|
|
printf "\033[92;1mApticron installed and configured\033[0m\n"
|