summaryrefslogtreecommitdiffstats
path: root/sx.sh
blob: beac660292303da7985ae229bd441f6205565dc2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
export TERM=xterm
pid=0

function display_container_header {
    echo "+====================================================="
    echo "| Container   : $HOSTNAME"
    echo "| OS          : $(</etc/redhat-release)"
    echo "| kubernetes  : $KUBERNETES_SERVICE_HOST"
    echo "| user        : $(whoami)"
    echo "| home        : $HOME"
    echo "+====================================================="
}

function start_service {
    echo "+====================================================="
    echo "| Container $HOSTNAME is now RUNNING"
    echo "+====================================================="
    while true
    do
      echo "live... (next try in 1 hour)" & sleep 3600
    done
}

if [ -n "$HOME" ]; then
    [ -d "$HOME" ] || mkdir -p $HOME
fi

display_container_header
start_service