lazy/init_sudo.sh
2024-08-02 19:16:07 +08:00

32 lines
730 B
Bash
Executable File

#!/usr/bin/env bash
scriptdir=$(dirname $(realpath $0))
if [[ $EUID -eq 0 ]]; then
echo "This script should not be run as root."
exit 1
fi
if [[ $(sudo id -u) -ne 0 ]]; then
echo "Please get sudo access first."
exit 1
fi
# ============================================================
. $scriptdir/configure_priv.sh $@
# ============================================================
# configure_docker_rootless() {
# [ -f ~/.config/docker/daemon.json ] && return
# read -p "要配置 Docker (Rootless mode) 吗?[N]: " response
# if [[ $response =~ ^[Yy]$ ]]; then
# cp $scriptdir/files/docker-rootless-daemon.json ~/.config/docker/daemon.json
# fi
# }
# configure_docker_rootless