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
13
Merge Requests
13
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
slapos.package
Commits
d29fbab6
Commit
d29fbab6
authored
May 04, 2013
by
Jondy Zhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Configure cygserver and syslog-ng when initialize cygwin
parent
f9cb2f01
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
3 deletions
+17
-3
windows/scripts/init-cygwin.sh
windows/scripts/init-cygwin.sh
+17
-3
No files found.
windows/scripts/init-cygwin.sh
View file @
d29fbab6
#! /bin/bash
#! /bin/bash
#
#
# When cygwin is installed, then call this script by Administrator:
# When cygwin is installed, then call this script by Administrator:
#
#
# /bin/bash/ --login -i init-cygwin.sh
# /bin/bash/ --login -i init-cygwin.sh
#
#
# It used to create root account.
# It will do:
#
# 1. Set uid of Adminstrator to 0, and create root account
#
# 2. Create .minttyrc and cygtty.bat, which used to start comand console
#
# 3. Configure cygserver
#
# 4. Configure syslog-ng
#
#
if
[[
!
"
$(
whoami
)
"
==
"Administrator"
]]
;
then
if
[[
!
"
$(
whoami
)
"
==
"Administrator"
]]
;
then
...
@@ -18,10 +25,11 @@ else
...
@@ -18,10 +25,11 @@ else
cp
/etc/passwd /etc/passwd.orig
cp
/etc/passwd /etc/passwd.orig
fi
fi
sed
-i
-e
"s/Administrator:unused:500:/Administrator:unused:0:/g"
/etc/passwd
grep
-q
"^root:"
/etc/passwd
grep
-q
"^root:"
/etc/passwd
if
((
$?
!=
0
))
;
then
if
((
$?
!=
0
))
;
then
myaccount
=
$(
grep
"^Administrator:"
/etc/passwd |
\
myaccount
=
$(
grep
"^Administrator:"
/etc/passwd |
\
sed
-e
"s/500:/0:/"
-e
"s/Administrator:/root:/g"
)
sed
-e
"s/Administrator:/root:/g"
)
if
[[
"
${
myaccount
:0:4
}
"
==
root
]]
;
then
if
[[
"
${
myaccount
:0:4
}
"
==
root
]]
;
then
echo
$myaccount
>>
/etc/passwd
echo
$myaccount
>>
/etc/passwd
else
else
...
@@ -51,5 +59,11 @@ EOF
...
@@ -51,5 +59,11 @@ EOF
chmod
+x /cygtty.bat
chmod
+x /cygtty.bat
fi
fi
# Configure cygserver
/usr/bin/cygserver-config
--yes
# Configure syslog-ng
/usr/bin/syslog-ng-config
--yes
exit
0
exit
0
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