scripts/nfs_client.sh

26 lines
621 B
Bash
Raw Permalink Normal View History

2024-01-28 01:33:19 +05:30
#!/bin/bash
# Variables
SERVER_IP="192.168.1.2"
NFS_SHARE="/mnt/arkdisk"
MOUNT_POINT="/mnt/arkdisk"
# Step 1: Install NFS Client
echo "Installing NFS client..."
sudo apt update
sudo apt install -y nfs-common
# Step 2: Create a Mount Point
echo "Creating mount point..."
sudo mkdir -p $MOUNT_POINT
# Step 3: Mount the NFS Share
echo "Mounting NFS share..."
sudo mount $SERVER_IP:$NFS_SHARE $MOUNT_POINT
# Step 4: Add Entry to /etc/fstab for Automatic Mounting
echo "Adding entry to /etc/fstab..."
echo "$SERVER_IP:$NFS_SHARE $MOUNT_POINT nfs defaults 0 0" | sudo tee -a /etc/fstab
echo "NFS client setup completed."