#!/bin/sh

WHOAMI=`who|sed -e 's/[[:space:]][[:space:]]*/ /g'|grep " tty7 "|cut -d ' ' -f 1`
if [ "$WHOAMI" = "" ];then
    WHOAMI=`who|sed -e 's/[[:space:]][[:space:]]*/ /g'|grep " :0 "|cut -d ' ' -f 1`
fi

if [ -n "$WHOAMI" ];then
    su - "$WHOAMI" -c  "/usr/bin/env DISPLAY=:0 && cd /usr/share/kylin-update-manager && python kylin-update-manager.py -auto"
fi
