From 054a4b89207aa88b6f9a40bfc9e73963d15161c2 Mon Sep 17 00:00:00 2001 From: tteckster Date: Mon, 17 Jul 2023 18:50:19 -0400 Subject: [PATCH] Delete cron-update-lxcs.sh --- misc/cron-update-lxcs.sh | 60 ---------------------------------------- 1 file changed, 60 deletions(-) delete mode 100644 misc/cron-update-lxcs.sh diff --git a/misc/cron-update-lxcs.sh b/misc/cron-update-lxcs.sh deleted file mode 100644 index 9a1f3b7b..00000000 --- a/misc/cron-update-lxcs.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env bash - -# Copyright (c) 2021-2023 tteck -# Author: tteck (tteckster) -# License: MIT -# https://github.com/tteck/Proxmox/raw/main/LICENSE - -clear -cat <<"EOF" - __ __ __ __ __ _ ________ ______ - / / / /___ ____/ /___ _/ /____ / / | |/ / ____/____ / ____/________ ____ - / / / / __ \/ __ / __ `/ __/ _ \ / / | / / / ___/ / / / ___/ __ \/ __ \ -/ /_/ / /_/ / /_/ / /_/ / /_/ __/ / /___/ / /___(__ ) / /___/ / / /_/ / / / / -\____/ .___/\__,_/\__,_/\__/\___/ /_____/_/|_\____/____/ \____/_/ \____/_/ /_/ - /_/ - -EOF - -add() { -while true; do - read -p "This script will add a cron job to update all LXCs at midnight. Proceed(y/n)?" yn - case $yn in - [Yy]*) break ;; - [Nn]*) exit ;; - *) echo "Please answer yes or no." ;; - esac -done - -sh -c '(crontab -l -u root 2>/dev/null; echo "0 0 * * * bash -c \"\$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/misc/update-lxcs-cron.sh)\"") | sed "$!N; /^\(.*\)\n\1$/!P; D" | sudo crontab -u root - >> /var/log/update-lxcs.log' -clear -echo -e "\n To view Update LXCs Cron logs: cat /var/log/update-lxcs-cron.log" -} - -remove() { - (crontab -l | grep -v "github.com/tteck/Proxmox/raw/main/misc/update-lxcs-cron.sh") | crontab - - rm /var/log/update-lxcs-cron.log - echo "Removed Update LXCs Cron from Proxmox VE" -} - -# Define options for the whiptail menu -OPTIONS=(Add "Add Update LXCs Cron to Proxmox VE" \ - Remove "Remove Update LXCs Cron from Proxmox VE") - -# Show the whiptail menu and save the user's choice -CHOICE=$(whiptail --title "Update LXCs Cron for Proxmox VE" --menu "Select an option:" 10 58 2 \ - "${OPTIONS[@]}" 3>&1 1>&2 2>&3) - -# Check the user's choice and perform the corresponding action -case $CHOICE in - "Add") - add - ;; - "Remove") - remove - ;; - *) - echo "Exiting..." - exit 0 - ;; -esac