Last active
November 22, 2023 18:09
-
-
Save vmenajr/e3b012e4a24ad18629b05395e3171e24 to your computer and use it in GitHub Desktop.
instruqt support lib
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@ | |
screen -t 0 | |
EOF | |
} |
line 28
line 23 comment
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hello