Skip to content

Instantly share code, notes, and snippets.

@parkerfoshay
Last active March 14, 2023 22:01
Show Gist options
  • Save parkerfoshay/6ae0d60dcb4569e430f7aa8d243a5454 to your computer and use it in GitHub Desktop.
Save parkerfoshay/6ae0d60dcb4569e430f7aa8d243a5454 to your computer and use it in GitHub Desktop.
instruqt-setup-L4
set -euxo pipefail
echo "Running track setup script"
until [ -f /opt/instruqt/bootstrap/host-bootstrap-completed ]; do
echo "Waiting for instruqt bootstrap to complete"
sleep 1
done
# check if temp dir exists
if [ ! -d /tmp ]; then
mkdir /tmp
fi
function init() {
agent variable set "CONNECTION_STRING" "$1"
# Append this onto the end of ~/.bashrc
cat >> ~/.bashrc <<EOF
if [[ -z "\$STY" ]]; then
screen -xRR default
CONECTION_STRING=$(agent variable get "CONNECTION_STRING")
fi
EOF
cat <<EOF >> /root/.screenrc
# ~/.screenrc configuration file
# Set the default shell
shell "/bin/bash"
# These lines give us a pretty navigation bar at the bottom
hardstatus off
hardstatus alwayslastline
hardstatus string '%{= kW}[ %{m}%H %{W}][%= %{= kw}%?%-Lw%?%{r}(%{g}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{W}][%{Y} %d/%m %{Y}%c %{W}]'
# Disable the startup message
startup_message off
# Disable Visual Bell
vbell off
# Increase the scrollback buffer
defscrollback 10000
# Use SHIFT-right and SHIFT-left arrow to change windows
bindkey ^[[1;2D prev
bindkey ^[[1;2C next
# Enable 'normal' scrolling, disable GNU screen scrolling
termcapinfo xterm* ti@:te@
EOF
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment