security sticker™
This commit is contained in:
38
stapleddipl/secure
Executable file
38
stapleddipl/secure
Executable file
@@ -0,0 +1,38 @@
|
||||
#!/bin/bash
|
||||
FILE=/tmp/$RANDOM
|
||||
TOP=1
|
||||
LEFT=5
|
||||
|
||||
VISAPAGES=1
|
||||
|
||||
# GPG Space
|
||||
NEXTPAGE=34
|
||||
NEXTPAGESMALL=60
|
||||
NEXTFIELDBOTTOM=13
|
||||
NEXTFIELDRIGHT=18
|
||||
NEXTFIELDRIGHTSMALL=30
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
echo "Syntax: $0 <SecurityNumber>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
sn=$1
|
||||
|
||||
source ../include/nixdorf
|
||||
init
|
||||
|
||||
makeNewline $TOP $FILE
|
||||
makeLeft $LEFT $FILE
|
||||
|
||||
printf "$sn" >> $FILE
|
||||
makeLeft $NEXTPAGE $FILE
|
||||
printf "$sn" >> $FILE
|
||||
|
||||
echo "Only use the pages saying \"VISAs\" on top"
|
||||
for (( i=1; i<=$VISAPAGES; i++)); do
|
||||
echo -e "Insert page $i of $VISAPAGES\n"
|
||||
printFile $FILE
|
||||
done
|
||||
|
||||
rm $FILE
|
||||
30
start_dialog
30
start_dialog
@@ -343,12 +343,36 @@ function askReg() {
|
||||
|
||||
}
|
||||
|
||||
function enterSecurityCode() {
|
||||
MAXLENGTH=6
|
||||
|
||||
askStr ${MAXLENGTH} "Security code" "Enter security code from the security sticker (e.g. S12345)."
|
||||
if [ $? -eq 1 ]; then
|
||||
return 1
|
||||
fi
|
||||
SECURITYCODE=$(cat $TMP)
|
||||
confirm "Security code" "$SECURITYCODE"
|
||||
return $?
|
||||
|
||||
}
|
||||
|
||||
function printSecurePassport(){
|
||||
checkLockFile
|
||||
diaBox "Insert Passport" "Please insert passport (Visas) into the printer.\nA print on EVERY Visa page is necessary."
|
||||
|
||||
cd "$1"
|
||||
./secure "$SECURITYCODE"
|
||||
cd ..
|
||||
rm $LOCKFILE
|
||||
}
|
||||
|
||||
function menuFor() {
|
||||
dialog --backtitle "$BT" \
|
||||
--menu "Select purpose:" 14 40 3 \
|
||||
1 "Registration" \
|
||||
2 "c3gov Stamp" \
|
||||
3 "GPG" \
|
||||
8 "Secure Passport" \
|
||||
9 "Back" 2> $TMP
|
||||
|
||||
choice=$(cat $TMP)
|
||||
@@ -372,6 +396,11 @@ function menuFor() {
|
||||
printGPG "$1"
|
||||
fi
|
||||
;;
|
||||
4) enterSecurityCode
|
||||
if [ $? -eq 0 ]; then
|
||||
printSecurePassport "$1"
|
||||
fi
|
||||
;;
|
||||
|
||||
esac
|
||||
unset FNAME
|
||||
@@ -380,6 +409,7 @@ function menuFor() {
|
||||
unset FP
|
||||
unset FIELD
|
||||
unset FFP
|
||||
unset SECURITYCODE
|
||||
}
|
||||
|
||||
function askForFunnyUserCreds() {
|
||||
|
||||
Reference in New Issue
Block a user