| bitreich-con-teaser-shell - bitreich-conference - Bitreich Conference System | |
| git clone git://bitreich.org/bitreich-conference git://enlrupgkhuxnvlhsf6lc3fzi… | |
| Log | |
| Files | |
| Refs | |
| Tags | |
| README | |
| LICENSE | |
| --- | |
| bitreich-con-teaser-shell (728B) | |
| --- | |
| 1 #!/bin/sh | |
| 2 | |
| 3 if [ $# -lt 1 ]; | |
| 4 then | |
| 5 year="$(date +%Y)" | |
| 6 else | |
| 7 year="$1" | |
| 8 fi | |
| 9 | |
| 10 function shell() { | |
| 11 cd "/home/presenter/con/${year}" | |
| 12 bash | |
| 13 } | |
| 14 | |
| 15 adpath="/br/gopher/con/${year}/ads" | |
| 16 framelines=25 | |
| 17 | |
| 18 while /bin/true; | |
| 19 do | |
| 20 clear | |
| 21 adfile="${adpath}/$(ls -1 "${adpath}" | shuf -n 1)" | |
| 22 nframes=$(( "$(wc -l < "${adfile}")" / $framelines)) | |
| 23 | |
| 24 i=0 | |
| 25 # Change the ad every 30 seconds. | |
| 26 while [ $i -lt 20 ]; | |
| 27 do | |
| 28 tput cup 0 0 | |
| 29 tput civis | |
| 30 tail -n +$((1+i%$nframes*$framelines)) "$adfile" | head … | |
| 31 # Redisplay every second, in case someone freshly attach… | |
| 32 i=$(($i + 1)) | |
| 33 | |
| 34 userinput="" | |
| 35 read -t 1 userinput | |
| 36 if [ $? -eq 0 ]; | |
| 37 then | |
| 38 # Be clear and clean. | |
| 39 clear | |
| 40 tput cvvis | |
| 41 shell | |
| 42 clear | |
| 43 tput civis | |
| 44 fi | |
| 45 done | |
| 46 done | |
| 47 |