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
3d70b4fa
Commit
3d70b4fa
authored
9 years ago
by
Thiago Abdo
Browse files
Options
Downloads
Patches
Plain Diff
[add user] Testing done, some fixes made
Signed-off-by:
Thiago Abdo
<
tja14@inf.ufpr.br
>
parent
37104e9a
Branches
Branches containing commit
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
+6
-6
6 additions, 6 deletions
hdd/adduser.sh
with
6 additions
and
6 deletions
hdd/adduser.sh
+
6
−
6
View file @
3d70b4fa
...
@@ -195,38 +195,38 @@ fi
...
@@ -195,38 +195,38 @@ fi
#See if exist the username that we are tryng to add with non local ID
#See if exist the username that we are tryng to add with non local ID
checkNotLocalName
=
$(
cat
/etc/passwd |
cut
-d
':'
-f1
,3 |
grep
-v
-e
":2....$"
-e
":1....$"
|
grep
-e
"^
$username
:"
)
checkNotLocalName
=
$(
cat
/etc/passwd |
cut
-d
':'
-f1
,3 |
grep
-v
-e
":2....$"
-e
":1....$"
|
grep
-e
"^
$username
:"
)
if
[
-
z
"
$checkNotLocalName
"
]
;
then
if
[
-
n
"
$checkNotLocalName
"
]
;
then
echo
$0
": Usuario não local com mesmo username"
echo
$0
": Usuario não local com mesmo username"
exit
22
exit
22
fi
fi
#See if exists the group name that we are trying to add with non local GID
#See if exists the group name that we are trying to add with non local GID
checkNotLocalGroupName
=
$(
cat
/etc/group |
grep
-v
-e
":2....:"
-e
":1....:"
|
grep
-e
"^
$groupname
:"
)
checkNotLocalGroupName
=
$(
cat
/etc/group |
grep
-v
-e
":2....:"
-e
":1....:"
|
grep
-e
"^
$groupname
:"
)
if
[
-
z
"
$checkNotLocalGroupName
"
]
;
then
if
[
-
n
"
$checkNotLocalGroupName
"
]
;
then
echo
$0
": Usuario não local com mesmo group name"
echo
$0
": Usuario não local com mesmo group name"
exit
22
exit
22
fi
fi
checkName
=
$(
cat
/etc/passwd |
cut
-d
':'
-f1-3
|
grep
-e
"^
$username
:"
)
checkName
=
$(
cat
/etc/passwd |
cut
-d
':'
-f1-3
|
grep
-e
"^
$username
:"
)
if
[
-
z
"
$checkName
"
]
;
then
if
[
-
n
"
$checkName
"
]
;
then
remove_user
"
$checkName
"
remove_user
"
$checkName
"
echo
$0
": encontrei outro usuario local com o mesmo nome, devo remove-lo"
echo
$0
": encontrei outro usuario local com o mesmo nome, devo remove-lo"
fi
fi
checkID
=
$(
cat
/etc/passwd |
cut
-d
':'
-f1-3
|
grep
-e
":
$uID
$"
)
checkID
=
$(
cat
/etc/passwd |
cut
-d
':'
-f1-3
|
grep
-e
":
$uID
$"
)
if
[
-
z
"
$checkID
"
]
;
then
if
[
-
n
"
$checkID
"
]
;
then
remove_user
"
$checkID
"
remove_user
"
$checkID
"
echo
$0
": encontrei outro usuario local com o mesmo id, devo remove-lo"
echo
$0
": encontrei outro usuario local com o mesmo id, devo remove-lo"
fi
fi
checkGID
=
$(
cat
/etc/group |
grep
-e
":
$gID
:"
)
checkGID
=
$(
cat
/etc/group |
grep
-e
":
$gID
:"
)
if
[
-
z
"
$checkGID
"
]
;
then
if
[
-
n
"
$checkGID
"
]
;
then
remove_group
"
$checkGID
"
remove_group
"
$checkGID
"
echo
$0
": encontrei outro usuario local com o mesmo id de grupo, devo remove-lo"
echo
$0
": encontrei outro usuario local com o mesmo id de grupo, devo remove-lo"
fi
fi
checkGName
=
$(
cat
/etc/group |
grep
-e
"^
$groupname
:"
)
checkGName
=
$(
cat
/etc/group |
grep
-e
"^
$groupname
:"
)
if
[
-
z
"
$checkGName
"
]
;
then
if
[
-
n
"
$checkGName
"
]
;
then
remove_group
"
$checkGName
"
remove_group
"
$checkGName
"
echo
$0
": encontrei outro usuario local com o mesmo nome de grupo, devo remove-lo"
echo
$0
": encontrei outro usuario local com o mesmo nome de grupo, devo remove-lo"
fi
fi
...
...
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