Skip to content

Patch 1#1

Merged
geekcomputers merged 4 commits intomasterfrom
unknown repository
Sep 30, 2017
Merged

Patch 1#1
geekcomputers merged 4 commits intomasterfrom
unknown repository

Conversation

@ghost
Copy link

@ghost ghost commented Sep 13, 2017

Used OSTYPE (since bash) instead of uname to save opening another process.

Avoided awk with standard shell logic, saving another process.

It should now be a little bit simpler to add new OS types to the if statement; just call the function and use upper- or lower-case 'S'. You can use other position parameters in the function for other differences in other OS types.

Root access on different setups may be needed for the -a flag with the passwd command. Using passwd package 1:4.2-3.1ubuntu5.3 on an Ubuntu 16.04.3 setup, I needed root access for the -a flag.

Made the message for users without passwords a more traditional, tidier ERROR message. It might be nice and handy to have a loop iterate over each username to supply both the name and the UID, perhaps other information too.

If you wind up keeping the line which had awk in it, I recommend instead using cut -d " " -f 1 as it's more portable (part of coreutils).

@geekcomputers geekcomputers merged commit fbdb8e6 into geekcomputers:master Sep 30, 2017
@geekcomputers
Copy link
Owner

geekcomputers commented Sep 30, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant