From 893d13af5371b0f3282969459cb277202d19e624 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 28 Dec 2025 00:11:29 +0000 Subject: [PATCH] Add Samba installation and rename readme to README.md - Add Samba file sharing installation and configuration to match README documentation (was documented but not implemented) - Rename ubuntu-readme.md to README.md for standard GitHub display - Update download instructions with actual GitHub repository URLs --- ubuntu-readme.md => README.md | 10 +++--- ubuntu-post-install.sh | 60 +++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+), 5 deletions(-) rename ubuntu-readme.md => README.md (98%) diff --git a/ubuntu-readme.md b/README.md similarity index 98% rename from ubuntu-readme.md rename to README.md index 58f5509..64c01d9 100644 --- a/ubuntu-readme.md +++ b/README.md @@ -56,12 +56,12 @@ Automated setup script for Ubuntu 24.04 Desktop that installs essential tools, c ### 1. Download the Script ```bash -# Download (replace URL with actual location) -wget https://your-domain.com/post-install.sh +# Clone the repository +git clone https://github.com/outis1one/post-ubuntu-install.git +cd post-ubuntu-install -# Or create manually -nano post-install.sh -# Paste the script content and save (Ctrl+O, Enter, Ctrl+X) +# Or download the script directly +wget https://raw.githubusercontent.com/outis1one/post-ubuntu-install/main/ubuntu-post-install.sh -O post-install.sh ``` ### 2. Make Executable diff --git a/ubuntu-post-install.sh b/ubuntu-post-install.sh index 04f4789..7cad4d6 100644 --- a/ubuntu-post-install.sh +++ b/ubuntu-post-install.sh @@ -243,6 +243,66 @@ echo "Verifying Docker installation..." docker --version || echo "Warning: Docker verification failed" docker compose version || echo "Warning: Docker Compose verification failed" +# Install and Configure Samba +echo "" +echo "Installing Samba file sharing..." +echo " - Samba: SMB/CIFS file server for network file sharing" +echo "" + +apt install -y samba || echo "Warning: Samba installation failed, continuing..." + +# Configure Samba share for primary drive +if command -v smbd &> /dev/null; then + echo "" + echo "Configuring Samba share for primary drive..." + + # Backup existing config + cp /etc/samba/smb.conf /etc/samba/smb.conf.backup-$(date +%Y%m%d-%H%M%S) + + # Add Primary share configuration + if ! grep -q "\[Primary\]" /etc/samba/smb.conf; then + cat >> /etc/samba/smb.conf << SAMBA_CONFIG + +# Primary drive share - added by post-install script +[Primary] + comment = Primary Drive + path = $ACTUAL_HOME/drives/primary + browseable = yes + read only = no + writable = yes + valid users = $ACTUAL_USER + create mask = 0775 + directory mask = 0775 +SAMBA_CONFIG + echo "✓ Added [Primary] share to Samba configuration" + else + echo "Samba [Primary] share already configured, skipping..." + fi + + # Add Samba user + echo "" + echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + echo "SAMBA PASSWORD SETUP" + echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + echo "" + echo "Set a password for Samba file sharing access." + echo "Tip: Using the same password as your system login is convenient." + echo "" + smbpasswd -a "$ACTUAL_USER" + + # Enable and restart Samba services + systemctl enable smbd nmbd || echo "Warning: Failed to enable Samba services" + systemctl restart smbd nmbd || echo "Warning: Failed to restart Samba services" + + echo "" + echo "✓ Samba configured successfully" + echo " Share name: Primary" + echo " Path: $ACTUAL_HOME/drives/primary" + echo " Access: \\\\$(hostname)\\Primary (Windows) or smb://$(hostname)/Primary (Mac/Linux)" +else + echo "✗ Samba installation failed, skipping configuration" +fi + # Install NetBird echo "" echo "Installing NetBird..."