blob: 11d999318790fca6d955d6813dc738d94c0247ae [file] [log] [blame]
Jens Wiklanderc0bc8082018-02-27 20:25:25 +01001#!/bin/sh
2#
3# /etc/init.d/optee
4#
5# Start/stop tee-supplicant (OP-TEE normal world daemon)
6#
7case "$1" in
8 start)
9 if [ -e /usr/sbin/tee-supplicant -a -e /dev/teepriv0 ]; then
Jerome Forissier0a9644d2018-08-17 10:34:59 +020010 printf "Starting tee-supplicant... "
11 /usr/sbin/tee-supplicant -d
12 [ $? = 0 ] && echo "OK" || echo "FAIL"
Jens Wiklanderc0bc8082018-02-27 20:25:25 +010013 else
14 echo "tee-supplicant or TEE device not found"
15 exit 1
16 fi
17
18 ;;
19 stop)
20 killall tee-supplicant
21 ;;
22 status)
23 cat /dev/teepriv0 2>&1 | grep -q "Device or resource busy" || not="not "
24 echo "tee-supplicant is ${not}active"
25 ;;
26esac