Skip to content
Snippets Groups Projects
kioskmode 553 B
Newer Older
  • Learn to ignore specific revisions
  • 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
    }
    
    start() {
        if [ ${ESAME_KIOSK_MODE} -eq 1 ]; then
    		echo "START KIOSK MODE";
    		touch ${ESAME_KIOSK_FILE};
    	fi
    }
    
    
    args=("$@")
    
    case "$1" in
    'start')
    	start
    	;;
    'stop')
    	stop
    	;;
    'restart')
    	stop
    	start
    	;;
    *)
    	echo "Usage: $0 { start | stop | restart }";
    	exit 1;
    	;;
    esac
    exit 0