#!/bin/bash

# Check if user 'rke' exists
if ! id -u rke &> /dev/null; then
    echo "Creating user 'rke'"
    # Create user 'rke' with home directory using useradd
    useradd --system -m -k /usr/libexec/rke2/skel/ rke
fi

# Add 'rke' to docker group
echo "Adding 'rke' to docker group"
usermod -aG docker,systemd-journal,wheel rke

echo "Done"
