--- buildman/install 2025/01/21 20:46:41 1.3 +++ buildman/install 2025/03/11 18:31:25 1.10 @@ -18,17 +18,17 @@ PROGN=`basename $0` -if [ $EUID -ne 0 ] -then - echo "$PROGN error: must run as root" - exit 1 -fi +#if [ "$UID" != "0" ] +#then +# echo "$PROGN error: must run as root" +# exit 1 +#fi TARGET="client" TUSER="build:6000" TGROUP="build:6000" BUILDMAN_MASTER="" -INSTALL_BASE="/usr/local" +INSTALL_BASE="/usr/local/bin" OS=`uname` @@ -47,14 +47,14 @@ fi tmphost=`echo ${THOST} | cut -d. -f1` THOST="${tmphost}" -if [ "$OS" == "SunOS" ] +if [ "$OS" = "SunOS" ] then BUILDMAN_BASE="/export/home/build" else BUILDMAN_BASE="/home/build" fi -while getopts ':t:u:g:b:m:i:' OPTION +while getopts ':t:u:g:b:m:i:h' OPTION do case $OPTION in @@ -76,7 +76,24 @@ do m) BUILDMAN_MASTER="${OPTARG}" + ;; + h) + echo "" + echo "BuildMan Installer" + echo " Copyright (C) 2025 Coherent Logic Development LLC" + echo "" + echo "" + echo "usage: ${PROGN} [-i ] [-b ] [-u ] [-g ] [-m " + echo " is the directory in which buildman will be installed" + echo " is the directory in which buildman will operate" + echo " is the username owning the files for buildman" + echo " is the numeric UID of the owner of the buildman files" + echo " is the group name owning the files for buildman" + echo " is the numeric GID of the group owning the buildman files" + echo " is the primary buildman host, supplied as IP address or FQDN" + exit 0 + ;; esac done @@ -89,13 +106,15 @@ T_GID=`echo ${TGROUP} | cut -d: -f2` groupadd -g ${T_GID} ${T_GRPNAM} useradd -u ${T_UID} -g ${T_GRPNAM} -c "BuildMan" -m -d "${BUILDMAN_BASE}" "${T_LOGIN}" -install -o ${T_UID} -g ${T_GID} -m 750 bm "${INSTALL_BASE}/sbin/bm" -install -o ${T_UID} -g ${T_GID} -m 750 bma "${INSTALL_BASE}/sbin/bma" +install -o ${T_UID} -g ${T_GID} -m 750 bm "${INSTALL_BASE}/bm" +install -o ${T_UID} -g ${T_GID} -m 750 bma "${INSTALL_BASE}/bma" DEF="/etc/default/bm" echo "BUILDMAN_BASE=${BUILDMAN_BASE}" > "${DEF}" +echo "BUILDMAN_USER=${T_LOGIN}" >> "${DEF}" +echo "BUILDMAN_GROUP=${T_GRPNAM}" >> "${DEF}" echo "BUILDMAN_UID=${T_UID}" >> "${DEF}" echo "BUILDMAN_GID=${T_GID}" >> "${DEF}" echo "BUILDMAN_MASTER=${BUILDMAN_MASTER}" >> "${DEF}"