A2osX/ADMIN/LISTUSERS.txt

83 lines
2.4 KiB
Plaintext
Raw Permalink Normal View History

NEW
PREFIX
AUTO 4,1
#!/BIN/SH
#
# This is Admin Script for listing the users logins
# found in the etc/passwd file.
#
ECHO "\f\n Admin: List System Users"
ECHO
ECHO "Got Here ";PAUSE
IF [ -D ${ROOT}ETC ]
ECHO "Got Here ETC True";PAUSE
ELSE
ECHO "Got Here ETC False";PAUSE
ECHO " Your ETC directory that should be in ${ROOT}"
ECHO " is missing. This directory is needed for the"
ECHO " operation of your system."
ECHO
READ -P " Should I create this direcory for you (Y/N)? : " Z
SWITCH $Z
CASE "Y"
CASE "y"
MD ${ROOT}ETC
ECHO "\f\n Admin: List System Users"
ECHO
BREAK
DEFAULT
ECHO "\n\nPress Return to Exit"
PAUSE
EXIT
END
FI
ECHO "Should Get Here right After ETC is True ";PAUSE
IF [ -F ${ROOT}ETC/PASSWD ]
ELSE
ECHO " Your PASSWD file is missing. It should be located in the"
ECHO " ${ROOT}/ETC directory. This file is needed for the"
ECHO " normal operation of your system Note there are specific A2osX"
ECHO " configurations where the absence of this file is by design."
ECHO
READ -P " Should I create the default A2osX PASSWD file (Y/N)? : " Z
SWITCH $Z
CASE "Y"
CASE "y"
ECHO "root:1cedeaefaffab15fd23d7a282c6610b1:0:0:A2osX Root:/root:/bin/sh" > ${ROOT}ETC/PASSWD
ECHO "guest:084e0343a0486ff05530df6c705c8bb4:1000:1000:Guest Account:/home/guest:/bin/sh" >> ${ROOT}ETC/PASSWD
ECHO "\f\n Admin: List System Users"
ECHO
BREAK
DEFAULT
ECHO "\n\nPress Return to Exit"
PAUSE
EXIT
END
FI
ECHO "Got Here ";PAUSE
# OK Now we can actually list the users!
ECHO " UID GID User Full Name Home Directory"
ECHO " ----- ----- -------- ------------------------- -------------------------"
SET LINE = 7
ECHO "Got Here ";PAUSE
FOR F IN `CAT ${ROOT}ETC/PASSWD`
SET PWUSER = `CUT -S : -F 1 "${F}"`
SET PWUID = `CUT -S : -F 3 "${F}"`
SET PWGID = `CUT -S : -F 4 "${F}"`
SET PWNAME = `CUT -S : -F 5 "${F}"`
SET PWHOME = `CUT -S : -F 6 "${F}"`
ECHO -N "\e[${LINE};1H${PWUID}"
ECHO -N "\e[${LINE};9H${PWGID}"
ECHO -N "\e[${LINE};16H${PWUSER}"
ECHO -N "\e[${LINE};26H${PWNAME}"
ECHO -N "\e[${LINE};53H${PWHOME}"
SET LINE = $LINE + 1
NEXT
ECHO
2019-03-19 01:11:03 +00:00
ECHO
ECHO "PRESS RETURN"
PAUSE
MAN
TEXT /MAKE/USR/SHARE/ADMIN/LISTUSERS