summaryrefslogtreecommitdiffstats
path: root/prog/studisfri/screenshot.sh
diff options
context:
space:
mode:
Diffstat (limited to 'prog/studisfri/screenshot.sh')
-rwxr-xr-xprog/studisfri/screenshot.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/prog/studisfri/screenshot.sh b/prog/studisfri/screenshot.sh
new file mode 100755
index 0000000..5fdc8a1
--- /dev/null
+++ b/prog/studisfri/screenshot.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+set -xe
+umask 0077
+p=`rev <<<$0 | cut -d/ -f1 | rev`
+t=`mktemp -p "" -d $p.XXX`
+librewolf --headless --profile $t --no-remote --new-instance --screenshot $t/screenshot.png $1
+mount | grep "on /proc type proc" | grep hidepid=invisible || echo POZOR! leakal bom ime datoteke v procfs! POPRAVI!!!
+h=`sha256sum $t/screenshot.png | cut -d\ -f1`
+[ -f ../www/studisfri/$h.png ] && echo datoteka_že_obstaja
+mv $t/screenshot.png ../www/studisfri/$h.png
+chmod o+r ../www/studisfri/$h.png
+echo zgoščena_vrednost $h
+rm -r $t