Browse Source

Added

master
Stefano Marinelli 7 years ago
commit
da39975867
  1. 3
      README.md
  2. 15
      chillicount.sh
  3. 3
      chillicount1.sh
  4. 19
      chillikill.pl
  5. 20
      chillilisten.pl
  6. 36
      daily_maint.sh
  7. 17
      generate_html.sh
  8. 7
      launchbrowser.sh
  9. 5
      launchde.sh
  10. 1
      note.html

3
README.md

@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
# bibliosangio
Scripts for BiblioSangio

15
chillicount.sh

@ -0,0 +1,15 @@ @@ -0,0 +1,15 @@
#!/bin/sh
TOTSESSION=$1
MIN=$((TOTSESSION/60))
while [ $MIN -gt 0 ]; do
clear > /dev/tty9
echo "Sessione in corso..." > /dev/tty9
echo "Minuti rimanenti: $MIN" > /dev/tty9
/dragas/generate_html.sh $MIN > /tmp/dragas/index.html
MIN=$((MIN-1));
sleep 59;
done

3
chillicount1.sh

@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
#!/bin/sh
/dragas/chillicount.sh $1 &

19
chillikill.pl

@ -0,0 +1,19 @@ @@ -0,0 +1,19 @@
#!/usr/bin/perl
use IO::Socket;
my $sock = new IO::Socket::INET (
LocalHost => '',
LocalPort => '7071',
Proto => 'tcp',
Listen => 1,
Reuse => 1,
);
die "Could not create socket: $!\n" unless $sock;
my $new_sock = $sock->accept();
while(<$new_sock>) {
# print $_;
# system("/usr/bin/killall VBoxSVC");
system("/usr/bin/pkill -9 X");
system("/usr/bin/pkill -9 perl");
}
close($sock);

20
chillilisten.pl

@ -0,0 +1,20 @@ @@ -0,0 +1,20 @@
#!/usr/bin/perl
use IO::Socket;
my $sock = new IO::Socket::INET (
LocalHost => '',
LocalPort => '7070',
Proto => 'tcp',
Listen => 1,
Reuse => 1,
);
die "Could not create socket: $!\n" unless $sock;
my $new_sock = $sock->accept();
while(<$new_sock>) {
# print $_;
system("sudo /dragas/chillicount1.sh $_");
system("/usr/bin/sudo /dragas/launchde.sh");
system("/usr/bin/pkill -9 X");
system("/usr/bin/pkill -9 perl");
}
close($sock);

36
daily_maint.sh

@ -0,0 +1,36 @@ @@ -0,0 +1,36 @@
#!/bin/bash
PATH="/usr/local/jdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/usr/pkg/bin:/usr/pkg/sbin"
export PATH
exec > /tmp/daily_maint.log
exec 2>&1
mkdir /tmp/dragas; cp /dragas/note.html /tmp/dragas/
echo "Waiting for network to settle (3 minutes)..."
sleep 30s;
echo "2.30 minutes left..."
sleep 30s;
echo "2 minutes left..."
sleep 30s;
echo "1.30 minute left..."
sleep 30s;
echo "1 minute left..."
sleep 30s;
echo "30 seconds left..."
sleep 30s;
echo "Proceeding..."
cd /usr/local/bibliosangio
git pull
cp /dragas/note.html /tmp/dragas/
docker pull biblioregistry.dragashosting.com/timeleft
docker pull biblioregistry.dragashosting.com/bibliochromium
docker pull biblioregistry.dragashosting.com/bibliomate
docker image prune -f
echo "Done!"

17
generate_html.sh

@ -0,0 +1,17 @@ @@ -0,0 +1,17 @@
#!/bin/sh
echo "<html>"
echo " <head>"
echo " <title>Residuo: $1 minuti</title>"
echo " <meta http-equiv="refresh" content="30">"
echo " </head> "
echo " <body> "
echo "<h2>Tempo Residuo di utilizzo: $1 minuti</h2><br>"
echo "<br><br>"
echo '<h2>Per iniziare a navigare, <a href="https://www.google.it" target="_blank">cliccare qui.</a></h2><br><br>'
echo '<h3>Per chiudere la sessione, cliccare su "Sistema" e "Termina Sessione"</h3><br><br>'
echo 'Per indicazioni e note, <a href="http://172.17.0.1:8000/note.html" target="_blank">cliccare qui.</a><br><br>'
echo "Si consiglia di minimizzare questa finestra. Il tempo residuo restera' bene in vista nella barra inferiore.<br>"
echo " </body> "
echo "</html> "

7
launchbrowser.sh

@ -0,0 +1,7 @@ @@ -0,0 +1,7 @@
#!/bin/bash
perl /dragas/chillilisten.pl &
perl /dragas/chillikill.pl &
x11docker --desktop --hostipc --user=1500 biblioregistry.dragashosting.com/bibliochromium
pkill -9 X;
exit;

5
launchde.sh

@ -0,0 +1,5 @@ @@ -0,0 +1,5 @@
#!/bin/bash
/usr/bin/x11docker --vt=2 --desktop --sharedir=/media/usb0 --lang=it --hostipc --alsa --printer --user=4242 biblioregistry.dragashosting.com/bibliomate
pkill -9 chillicount;
pkill -9 X;
exit;

1
note.html

@ -0,0 +1 @@ @@ -0,0 +1 @@
Le chiavette vanno inserite PRIMA di utilizzare il computer, altrimenti non funzioneranno
Loading…
Cancel
Save