#!/bin/bash
# A-Shell / docker startup
# Usage:
#   run.sh <userid> <gid> <TERM>
# Edit History
# [004] 30-Jun-26 Change bin to bin64; sys64: to sys70:
# [003] 03-Sep-18 Change sys63: to sys64:
# [002] 04-Sep-16 Add -silo switch (new in ashell 6.3.1524 to stifle 
#              pid-related logic which assumed normal/visible pids /jdm
# [001] 03-Sep-16 Add 3rd arg to pick up TERM env var (which seems to 
#              get reset to xterm on the docker launch; perhaps there
#              is a better way to just preserve the host TERM directly?) /jdm

PATH=$PATH:$HOME/bin:/vm/miame/bin
#TERM=am75g
#TERM=linux
export PATH TERM 
set +o monitor

echo 'user ' $1
echo 'gid ' $2
read -p "Press [Enter] key to continue ..."

groupadd -g $2 ashell
useradd -g $2 $1

echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
# exec su -m $1 --command="ashell -hetcki bn"
# exec ashell -n log sys:

exec /vm/sys/bin64/ashell -i /vm/miame/miame.ini -silo -td $3 -mntsys sys70:=/vm/sys -n log sys:

