#! /usr/bin/sh 

# Check for root access 
if [ "$EUID" -ne 0 ]; then 
    echo "You need root access to run this script. Exiting..."
    sleep 2
    exit
fi

# Update and Upgrade the system
apt update && apt upgrade -y

# Install common tools
apt install fish curl wget git fzf -y

# Set shell to fish 
chsh -s $(which fish)

# Install Docker
curl -fsSL https://get.docker.com | sh

# Install Portainer 
docker run -d \
    --name="portainer" \
    --restart always \
    -p 9000:9000 \
    -p 8000:8000 \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -v portainer_data:/data \
    portainer/portainer-ce:latest