#!/bin/bash
PIS_SBIN="${PIS_SBIN:-/sbin}"
if [ -z "${PIS_LIBDIR:-}" ]; then
    case "$(uname -m)" in x86_64) PIS_LIBDIR=/usr/lib64/pis ;; *) PIS_LIBDIR=/usr/lib/pis ;; esac
fi
. "$PIS_LIBDIR/pis_lib" 2>/dev/null || . "$(dirname "$0")/pis_lib" || exit 1
pis_init || exit 1
while true; do
    choice=$(dialog --stdout --backtitle "$PIS_BACKTITLE" --title "User Configuration" \
        --menu "Wheel: $(pis_state_read wheel_group) | Last user: $(pis_state_read user)" 0 0 0 \
        wheel "Activate or deactivate wheel administration" \
        add "Add a new user") || exit 0
    case "$choice" in
        wheel) "$PIS_SBIN/pis_set_wheel_group" ;;
        add) "$PIS_SBIN/pis_add_user" ;;
    esac
done
