Files

94 lines
2.9 KiB
Bash
Raw Permalink Normal View History

2026-09-19 13:27:49 +02:00
#!/bin/bash
2026-09-19 13:41:48 +02:00
# Install Unattended-Upgrades Package
2026-09-19 13:11:42 +02:00
# Update package list and install unattended-upgrades
2026-09-19 13:45:00 +02:00
2026-09-19 13:11:42 +02:00
echo "Updating package list and installing unattended-upgrades..."
apt update
apt install unattended-upgrades -y
2026-09-19 13:41:48 +02:00
# Edit Configuration
2026-09-19 13:11:42 +02:00
# Open the configuration file for editing
echo "Opening configuration file for editing..."
nano /etc/apt/apt.conf.d/50unattended-upgrades
# Prompt user to un-comment necessary lines
echo 'Un-comment the following lines (remove "//"):'
echo '"origin=Debian,codename=${distro_codename}-updates";'
echo '"origin=Debian,codename=${distro_codename}-proposed-updates";'
echo '"origin=Debian,codename=${distro_codename},label=Debian";'
echo '"origin=Debian,codename=${distro_codename},label=Debian-Security";'
echo '"origin=Debian,codename=${distro_codename}-security,label=Debian-Security";'
# Prompt user to add email for notifications (optional)
echo "Enter your email to receive notifications about applied updates (optional):"
read email
echo "Unattended-Upgrade::Mail \"$email\";" >> /etc/apt/apt.conf.d/50unattended-upgrades
# Save and close the file
echo "Save the file by pressing [Ctrl+O] and exit with [Ctrl+X]."
# Enable automatic updates
echo "Enabling automatic updates..."
dpkg-reconfigure --priority=low unattended-upgrades
2026-09-19 13:41:48 +02:00
# Tailscale Installation
2026-09-19 13:11:42 +02:00
# Install Tailscale
echo "Installing Tailscale..."
curl -fsSL https://tailscale.com/install.sh | sh
# Start Tailscale and add to Tailscale network
echo "Starting Tailscale and adding to network..."
tailscale up
# Add autoupdate
echo "Enabling autoupdate for Tailscale..."
tailscale set --auto-update
2026-09-19 13:41:48 +02:00
# Add CIFS Folder to LXC
2026-09-19 13:11:42 +02:00
# Install cifs-utils
echo "Installing cifs-utils..."
apt install cifs-utils -y
# Create mount folder
2026-09-19 13:27:49 +02:00
echo "Creating mount folder for Synology Shared folder..."
2026-09-19 13:11:42 +02:00
mkdir /media/synolager
echo "You can rename the folder as desired, but remember it for the following steps."
# Create credential file
echo "Creating credential file..."
nano /etc/synocred
# Prompt for Synology username and password
echo "Enter your Synology username:"
read syno_user
echo "Enter your Synology password:"
read syno_pass
# Write credentials to file
echo "username=$syno_user" >> /etc/synocred
echo "password=$syno_pass" >> /etc/synocred
# Set permissions for credential file
echo "Setting permissions for credential file..."
sudo chown root: /etc/synocred
sudo chmod 600 /etc/synocred
# Edit fstab to add mount points
echo "Editing fstab to add mount points..."
nano /etc/fstab
# Prompt for Synology server IP and shared folder
echo "Enter the IP address of your Synology server:"
read syno_ip
echo "Enter the shared folder name on your Synology server:"
read shared_folder
# Write mount point information to fstab
echo "//${syno_ip}/${shared_folder} /media/synolager cifs credentials=/etc/synocred,file_mode=0777,dir_mode=0777 0 0" >> /etc/fstab
# Mount the share
echo "Mounting the share..."
2026-09-19 13:27:49 +02:00
sudo mount /media/synolager