Added permanent license option

main
jonas 11 months ago
parent 329bb8b427
commit ae8af99ef7

@ -6,7 +6,7 @@ if [ "${UID}" = "" ] || [ "${GID}" = "" ]; then
exit 1 exit 1
fi fi
if [ "${USER}" = "" ] || [ "${USER}" = "root"]; then if [ "${USER}" = "" ] || [ "${USER}" = "root" ]; then
echo "USER variable is not properly set, current value: ${USER}" echo "USER variable is not properly set, current value: ${USER}"
exit 1 exit 1
fi fi
@ -20,4 +20,4 @@ fi
groupadd -g ${GID} user groupadd -g ${GID} user
useradd ${USER} -d ${HOME} -s /bin/bash -u ${UID} -g ${GID} useradd ${USER} -d ${HOME} -s /bin/bash -u ${UID} -g ${GID}
sudo -Eu ${USER} "/opt/SMART Technologies/Notebook Software/bin/Notebook/notebook" ${SMART_ARGS} sudo -Eu ${USER} "/opt/SMART Technologies/Notebook Software/bin/Notebook/notebook" ${SMART_ARGS}

@ -3,17 +3,39 @@
# Allow local and docker connections to X11 on the host # Allow local and docker connections to X11 on the host
xhost + local:docker >/dev/null xhost + local:docker >/dev/null
# TODO: Add /media to mapped directories to allow removable media # Populate required variables if empty
[ "${USER}" = "" ] && USER=$(whoami)
[ "${HOME}" = "" ] && HOME="/home/${USER}"
[ "${HOSTNAME}" = "" ] && HOSTNAME=$(hostname)
[ "${UID}" = "" ] && UID=$(id -u)
[ "${GID}" = "" ] && GID=$(id -g "${USER}")
# Include /media/$USER folder if it exists for removable media
if [ -d "/media/${USER}" ]; then
echo "Finding mounted removable media:"
for i in $(find "/media/${USER}/" -mindepth 1 -maxdepth 1 -type d); do
echo " Found ${i}"
USER_MEDIA_DIR_ARG="${USER_MEDIA_DIR_ARG} -v ${i}:${i}"
done
fi
# Notebook writes some licensing data under /opt, so this
# dir gets mapped to the current users home directory too
LICENSE_DIR="${HOME}/.config/smart-notebook-license"
LICENSE_DIR_CONTAINER="/opt/SMART Technologies/common/data/"
[ ! -d "${LICENSE_DIR}" ] && mkdir -p "${LICENSE_DIR}"
# Run docker container # Run docker container
docker run \ docker run \
-v /tmp/.X11-unix:/tmp/.X11-unix \ -v /tmp/.X11-unix:/tmp/.X11-unix \
-v ${HOME}:${HOME} \ -v "${LICENSE_DIR}":"${LICENSE_DIR_CONTAINER}" \
-e DISPLAY=${DISPLAY} \ -v "${HOME}":"${HOME}" \
-e HOME=${HOME} \ ${USER_MEDIA_DIR_ARG} \
-e USER=${USER} \ -e DISPLAY="${DISPLAY}" \
-e UID=${UID} \ -e HOME="${HOME}" \
-e GID=$(id -g ${USER}) \ -e USER="${USER}" \
-e SMART_ARGS=${@} \ -e UID="${UID}" \
-h ${HOSTNAME} \ -e GID="${GID}" \
notebook-gui -e SMART_ARGS="${@}" \
-h "${HOSTNAME}" \
notebook-gui

Loading…
Cancel
Save