From 48a75978bd08f908f3018cbbd6e633d1cf32cc37 Mon Sep 17 00:00:00 2001
From: "Jory A. Pratt" <geekypenguin@gmail.com>
Date: Thu, 2 Jul 2026 07:25:54 -0500
Subject: [PATCH 6/7] fix: make uninstallers remove only the marked crontab
block.
Stop deleting unrelated saytime.pl cron jobs, handle empty crontabs more
safely, remove asl3-ini.sh, and use HTTPS for the sound file manifest.
---
uninstall_asl3_saytime_weather_timeformat.sh | 9 ++++++---
uninstaller_remove_audio_files.sh | 11 +++++++----
2 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/uninstall_asl3_saytime_weather_timeformat.sh b/uninstall_asl3_saytime_weather_timeformat.sh
index 6a14d5c..a58b9b0 100644
--- a/uninstall_asl3_saytime_weather_timeformat.sh
+++ b/uninstall_asl3_saytime_weather_timeformat.sh
@@ -91,6 +91,7 @@ confirm_uninstall() {
echo "This will remove:"
echo
echo " Scripts:"
+ echo " $SBIN_DIR/asl3-ini.sh"
echo " $SBIN_DIR/asl3-weatherapi-update.sh"
echo " $SBIN_DIR/show_weatherapi.sh"
echo " $SBIN_DIR/saytime.pl"
@@ -176,14 +177,15 @@ remove_crontab_entries() {
/ASL3 Saytime Weather TimeFormat/ { inblock=1; next }
inblock && /END ASL3 Saytime Weather TimeFormat/ { inblock=0; next }
!inblock { print }
- ' | \
- grep -v "/usr/local/sbin/saytime\.pl" > "$tmpfile" || true
+ ' > "$tmpfile" || true
if [ -s "$tmpfile" ]; then
crontab "$tmpfile" || warn "Could not install cleaned root crontab."
- else
+ elif crontab -l >/dev/null 2>&1; then
crontab -r 2>/dev/null || true
log "Root crontab is now empty and was removed."
+ else
+ log "No root crontab entries remain."
fi
after_count="$(crontab -l 2>/dev/null | wc -l | awk '{print $1}')"
@@ -223,6 +225,7 @@ remove_systemd_files() {
remove_scripts() {
log "Removing installed scripts."
+ remove_file "$SBIN_DIR/asl3-ini.sh"
remove_file "$SBIN_DIR/asl3-weatherapi-update.sh"
remove_file "$SBIN_DIR/show_weatherapi.sh"
remove_file "$SBIN_DIR/saytime.pl"
diff --git a/uninstaller_remove_audio_files.sh b/uninstaller_remove_audio_files.sh
index 6d8c59a..687a34f 100644
--- a/uninstaller_remove_audio_files.sh
+++ b/uninstaller_remove_audio_files.sh
@@ -36,7 +36,7 @@ TIMER_NAME="asl3-weatherapi-update.timer"
CACHE_DIR="/var/cache/asl3-saytime-weather"
SOUNDS_DIR="/usr/local/share/asterisk/sounds/custom"
-ORIGINAL_SOUND_ZIP_URL="http://198.58.124.150/tw/sound_files.zip"
+ORIGINAL_SOUND_ZIP_URL="https://198.58.124.150/tw/sound_files.zip"
YES=0
@@ -92,6 +92,7 @@ confirm_uninstall() {
echo "This will remove:"
echo
echo " Scripts:"
+ echo " $SBIN_DIR/asl3-ini.sh"
echo " $SBIN_DIR/asl3-weatherapi-update.sh"
echo " $SBIN_DIR/show_weatherapi.sh"
echo " $SBIN_DIR/saytime.pl"
@@ -180,14 +181,15 @@ remove_crontab_entries() {
/ASL3 Saytime Weather TimeFormat/ { inblock=1; next }
inblock && /END ASL3 Saytime Weather TimeFormat/ { inblock=0; next }
!inblock { print }
- ' | \
- grep -v "/usr/local/sbin/saytime\.pl" > "$tmpfile" || true
+ ' > "$tmpfile" || true
if [ -s "$tmpfile" ]; then
crontab "$tmpfile" || warn "Could not install cleaned root crontab."
- else
+ elif crontab -l >/dev/null 2>&1; then
crontab -r 2>/dev/null || true
log "Root crontab is now empty and was removed."
+ else
+ log "No root crontab entries remain."
fi
after_count="$(crontab -l 2>/dev/null | wc -l | awk '{print $1}')"
@@ -228,6 +230,7 @@ remove_systemd_files() {
remove_scripts() {
log "Removing installed scripts."
+ remove_file "$SBIN_DIR/asl3-ini.sh"
remove_file "$SBIN_DIR/asl3-weatherapi-update.sh"
remove_file "$SBIN_DIR/show_weatherapi.sh"
remove_file "$SBIN_DIR/saytime.pl"
--
2.47.3