#!/bin/sh
# Copyright (C) 2013 Jolla Oy
# Contact: Pekka Lundstrom  <pekka.lundstrom@jollamobile.com>
#
# Checks that user $1 is same as default user

[ -z "$1" ] && echo "$0 missing UID" && exit 1
echo "$0 checking  $1"
DEF_UID=$(grep "^UID_MIN" /etc/login.defs |  tr -s " " | cut -d " " -f2)
if [ $1 -eq $DEF_UID ]; then
    exit 0
else
    echo "Preventing session start for $1"
    exit 1
fi


