Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
users-openslx
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Harbor Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cdn
users-openslx
Commits
5ba9d6e8
Commit
5ba9d6e8
authored
9 years ago
by
Thiago Abdo
Browse files
Options
Downloads
Patches
Plain Diff
[add user] add some output
Signed-off-by:
Thiago Abdo
<
tja14@inf.ufpr.br
>
parent
3d70b4fa
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
hdd/adduser.sh
+15
-14
15 additions, 14 deletions
hdd/adduser.sh
with
15 additions
and
14 deletions
hdd/adduser.sh
+
15
−
14
View file @
5ba9d6e8
...
...
@@ -98,6 +98,7 @@ remove_group(){
#get user that is direct from this group
local
username
=
$(
echo
$group
|
cut
-d
':'
-f1
)
;
local
userDetail
=
$(
cat
/etc/passwd |
cut
-d
':'
-f1-3
|
grep
-e
"^
$username
:"
)
echo
$0
": Removendo usuário "
$username
" do group"
#remove user that is from this group
remove_user
"
$userDetail
"
...
...
@@ -207,28 +208,28 @@ if [ -n "$checkNotLocalGroupName" ]; then
exit
22
fi
checkName
=
$(
cat
/etc/passwd |
cut
-d
':'
-f1-3
|
grep
-e
"^
$username
:"
)
if
[
-n
"
$checkName
"
]
;
then
remove_user
"
$checkName
"
echo
$0
": encontrei outro usuario local com o mesmo nome, devo remove-lo"
fi
checkID
=
$(
cat
/etc/passwd |
cut
-d
':'
-f1-3
|
grep
-e
":
$uID
$"
)
if
[
-n
"
$checkID
"
]
;
then
remove_user
"
$checkID
"
echo
$0
": encontrei outro usuario local com o mesmo id, devo remove-lo"
fi
checkGID
=
$(
cat
/etc/group |
grep
-e
":
$gID
:"
)
if
[
-n
"
$checkGID
"
]
;
then
remove_group
"
$checkGID
"
echo
$0
": encontrei outro usuario local com o mesmo id de grupo, devo remove-lo"
remove_group
"
$checkGID
"
fi
checkGName
=
$(
cat
/etc/group |
grep
-e
"^
$groupname
:"
)
if
[
-n
"
$checkGName
"
]
;
then
remove_group
"
$checkGName
"
echo
$0
": encontrei outro usuario local com o mesmo nome de grupo, devo remove-lo"
remove_group
"
$checkGName
"
fi
checkName
=
$(
cat
/etc/passwd |
cut
-d
':'
-f1-3
|
grep
-e
"^
$username
:"
)
if
[
-n
"
$checkName
"
]
;
then
echo
$0
": encontrei outro usuario local com o mesmo nome, devo remove-lo"
remove_user
"
$checkName
"
fi
checkID
=
$(
cat
/etc/passwd |
cut
-d
':'
-f1-3
|
grep
-e
":
$uID
$"
)
if
[
-n
"
$checkID
"
]
;
then
echo
$0
": encontrei outro usuario local com o mesmo id, devo remove-lo"
remove_user
"
$checkID
"
fi
#add local user
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment