mirror of
https://github.com/A2osX/A2osX.git
synced 2024-11-23 07:35:19 +00:00
76 lines
2.2 KiB
Plaintext
76 lines
2.2 KiB
Plaintext
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
|
||
IF [ -D ${ROOT}ETC ]
|
||
ELSE
|
||
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
|
||
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
|
||
# OK Now we can actually list the users!
|
||
ECHO " UID GID User Full Name Home Directory"
|
||
ECHO " ----- ----- -------- ------------------------- -------------------------"
|
||
SET LINE = 7
|
||
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
|
||
ECHO
|
||
ECHO "PRESS RETURN"
|
||
PAUSE
|
||
MAN
|
||
TEXT /MAKE/USR/SHARE/ADMIN/LISTUSERS
|