Skip to content
Snippets Groups Projects
kioskmode 616 B
Newer Older
Alberto LIVIO BECCARIA's avatar
Alberto LIVIO BECCARIA committed
#!/bin/bash

# Se il kiosk mode verrà utilizzato anche in altre situazioni, spostare
# il file in /local/kiosk.mode
ESAME_KIOSK_FILE=/local/moodle/bin/approve.lock
Alberto LIVIO BECCARIA's avatar
Alberto LIVIO BECCARIA committed

stop() {
    if [ -f ${ESAME_KIOSK_FILE} ]; then
        echo "STOP KIOSK";
        rm -rf ${ESAME_KIOSK_FILE};
    fi
Alberto LIVIO BECCARIA's avatar
Alberto LIVIO BECCARIA committed
}

start() {
    if [ ${ESAME_KIOSK_MODE} -eq 1 ]; then
        echo "START KIOSK MODE";
        touch ${ESAME_KIOSK_FILE};
    fi
Alberto LIVIO BECCARIA's avatar
Alberto LIVIO BECCARIA committed
}


args=("$@")

case "$1" in
'start')
Alberto LIVIO BECCARIA's avatar
Alberto LIVIO BECCARIA committed
'stop')
Alberto LIVIO BECCARIA's avatar
Alberto LIVIO BECCARIA committed
'restart')
Alberto LIVIO BECCARIA's avatar
Alberto LIVIO BECCARIA committed
*)
    echo "Usage: $0 { start | stop | restart }";
    exit 1;
    ;;
Alberto LIVIO BECCARIA's avatar
Alberto LIVIO BECCARIA committed
esac
exit 0