mirror of
https://github.com/wickedyoda/public-setupfiles.git
synced 2026-11-16 13:31:56 -06:00
changes
many changes
This commit is contained in:
1 parent
2863d63ca7
commit
411f266ceb
5 files changed
+4
-76
No files matched your search
@@ -9,5 +9,6 @@ sudo systemctl enable cron
|
||||
sudo systemctl start cron
|
||||
|
||||
# Echo the command below into the file /etc/crontab
|
||||
echo 'MAILTO="alert@tyates.one"
|
||||
0 */6 * * * root /home/traver/public-setupfiles/updates_scripts/updates.sh' | sudo tee -a /etc/crontab
|
||||
echo '"MAILTO="alerts@tyates.one"
|
||||
0 */6 * * * root apt-get update && apt-get -y -d full-upgrade && apt-get autoremove -y && sudo apt-get clean -y && sudo apt-get purge -y' | sudo tee -a /etc/crontab
|
||||
0 */1 * * * root mount -a #makes sure the nas is mounted
|
||||
Whitespace-only changes.
@@ -1,42 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import subprocess
|
||||
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import subprocess
|
||||
|
||||
# Check if Python 3 is installed
|
||||
try:
|
||||
subprocess.run(["python3", "--version"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, check=True)
|
||||
except subprocess.CalledProcessError:
|
||||
print("Python 3 is not installed. Installing Python 3...")
|
||||
subprocess.run(["sudo", "apt", "update"])
|
||||
subprocess.run(["sudo", "apt", "install", "python3", "-y"])
|
||||
|
||||
# Rest of the script as before
|
||||
# ...
|
||||
|
||||
# Update package lists and install cron
|
||||
subprocess.run(["sudo", "apt", "update"])
|
||||
subprocess.run(["sudo", "apt", "install", "cron", "-y"])
|
||||
|
||||
# Enable and start the cron service
|
||||
subprocess.run(["sudo", "systemctl", "enable", "cron"])
|
||||
subprocess.run(["sudo", "systemctl", "start", "cron"])
|
||||
|
||||
# Stop the cron service to make changes
|
||||
subprocess.run(["sudo", "systemctl", "stop", "cron"])
|
||||
|
||||
# Define the cron job command
|
||||
cron_job_command = (
|
||||
'MAILTO="alerts@tyates.one"\n'
|
||||
'0 */6 * * * root /home/traver/public-setupfiles/updates_scripts/updates.sh'
|
||||
)
|
||||
|
||||
# Write the cron job to a file
|
||||
with open("/etc/cron.d/auto_updates", "w") as cron_file:
|
||||
cron_file.write(cron_job_command)
|
||||
|
||||
# Restart the cron service to apply the new cron job
|
||||
subprocess.run(["sudo", "systemctl", "start", "cron"])
|
||||
@@ -1,31 +0,0 @@
|
||||
/#bash
|
||||
|
||||
#Make sure Cache is updated
|
||||
apt update
|
||||
|
||||
# Bring system up to date (can be # out as not always required)
|
||||
apt upgrade -y
|
||||
|
||||
#install certs app
|
||||
apt install ca-certificates curl gnupg -y
|
||||
|
||||
#import keyrings
|
||||
install -m 0755 -d /etc/apt/keyrings
|
||||
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
|
||||
chmod a+r /etc/apt/keyrings/docker.gpg
|
||||
|
||||
#Add docker repo to apt sources
|
||||
echo \
|
||||
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
|
||||
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
|
||||
tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||
|
||||
#Pull cache sources including docker now.
|
||||
apt update
|
||||
|
||||
#install docker
|
||||
apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y
|
||||
|
||||
#Add current user to docker admin group, takes affect after logout and back in
|
||||
usermod -aG docker $USER
|
||||
newgrp docker
|
||||
@@ -22,7 +22,7 @@ sudo systemctl stop cron
|
||||
# Added new line to test.
|
||||
echo '"MAILTO="alerts@tyates.one"
|
||||
0 */6 * * * root apt-get update && apt-get -y -d full-upgrade && apt-get autoremove -y && sudo apt-get clean -y && sudo apt-get purge -y' | sudo tee -a /etc/crontab
|
||||
|
||||
0 */1 * * * root mount -a #makes sure the nas is mounted
|
||||
|
||||
# Restart the cron service to apply the new cron job
|
||||
sudo systemctl start cron
|
||||
Reference in new issue
Block a user