Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.package
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Nicolas Wavrant
slapos.package
Commits
07383edf
Commit
07383edf
authored
May 04, 2013
by
Jondy Zhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
No default password when create an user
parent
b5c09ebe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
windows/scripts/useradd
windows/scripts/useradd
+5
-2
No files found.
windows/scripts/useradd
View file @
07383edf
...
...
@@ -73,11 +73,14 @@ if [[ "$USER_NAME" == "" ]] ; then
exit
1
fi
USER_HOME
=
${
USER_HOME
:
=/home/
$USER_NAME
}
USER_PASSWORD
=
${
USER_PASSWORD
:
=
$USER_NAME
}
if
((
$?
==
0
))
;
then
if
[[
$ACTION
==
"ADD"
]]
;
then
NET USER
"
${
USER_NAME
}
"
"
${
USER_PASSWORD
}
"
/ADD
if
[[
"
${
USER_PASSWORD
}
"
==
""
]]
;
then
NET USER
"
${
USER_NAME
}
"
/ADD /PASSWORDREQ:No
else
NET USER
"
${
USER_NAME
}
"
"
${
USER_PASSWORD
}
"
/ADD
fi
grep
-q
"^
${
USER_NAME
}
"
/etc/passwd
&&
sed
-i
-e
"/^
${
USER_NAME
}
/d"
/etc/passwd
mkpasswd |
grep
"^
${
USER_NAME
}
:"
>>
/etc/passwd
[[
$USER_HOME
==
"/home/
$USER_NAME
"
]]
||
sed
-i
-e
"s%:/home/
${
USER_NAME
}
:%:
${
USER_HOME
}
:%g"
/etc/passwd
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment