#!/bin/bash
# Author: Steven Shiau <steven _at_ nchc org tw>
# License: GPL
# Description: Get the common users name (not system related users name)

export LC_ALL=C
if [ -e /etc/debian_version ]; then
  # For Debian, the common users uid start from 1000
  # uid_del_begin="1000"
  users="$(awk -F":" '$3 >= 1000 {print $1}' /etc/passwd)"
elif [ -e /etc/SuSE-release ]; then
  # SuSE
  # the common users uid start from 1000
  # uid_del_begin="1000"
  users="$(awk -F":" '$3 >= 1000 {print $1}' /etc/passwd)"
else
  # For RH-like, the common users uid start from 500
  #uid_del_begin="500"
  users="$(awk -F":" '$3 >= 500 {print $1}' /etc/passwd)"
fi
# if not found, return 1
[ -z "$users" ] && exit 1

echo $users
exit 0
