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
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
Kristopher Ruzic
slapos.package
Commits
3512ee0a
Commit
3512ee0a
authored
Jul 04, 2013
by
Jondy Zhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show error and exit when run post-install script
parent
f52dbd09
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
+12
-6
windows/scripts/post-install.sh
windows/scripts/post-install.sh
+12
-6
No files found.
windows/scripts/post-install.sh
View file @
3512ee0a
...
@@ -14,11 +14,18 @@
...
@@ -14,11 +14,18 @@
#
#
# * Change readme.txt to dos format
# * Change readme.txt to dos format
#
#
function
show_error_exit
()
{
echo
Error:
$1
read
-n
1
-p
"Press any key to exit..."
exit
1
}
password_filename
=
/etc/passwd
password_filename
=
/etc/passwd
echo
Checking passwd file ...
echo
Checking passwd file ...
if
[[
!
-f
$password_filename
]]
;
then
if
[[
!
-f
$password_filename
]]
;
then
echo
No passwd file found.
echo
No passwd file found.
mkpasswd
>
$password_filename
mkpasswd
-l
>
$password_filename
||
show_error_exit
"mkpasswd failed"
echo
Generate passwd file OK.
echo
Generate passwd file OK.
else
else
echo
Check passwd file OK.
echo
Check passwd file OK.
...
@@ -27,7 +34,7 @@ fi
...
@@ -27,7 +34,7 @@ fi
echo
Checking group file ...
echo
Checking group file ...
if
[[
!
-f
/etc/group
]]
;
then
if
[[
!
-f
/etc/group
]]
;
then
echo
No group file found.
echo
No group file found.
mkgroup
>
/etc/group
mkgroup
-l
>
/etc/group
||
show_error_exit
"mkgroup failed"
echo
Generate group file OK.
echo
Generate group file OK.
else
else
echo
Check group file OK.
echo
Check group file OK.
...
@@ -105,4 +112,3 @@ cp /etc/slapos/scripts/slap-runner.html{,.orig}
...
@@ -105,4 +112,3 @@ cp /etc/slapos/scripts/slap-runner.html{,.orig}
echo
Run post-install script successfully.
echo
Run post-install script successfully.
read
-n
1
-t
60
-p
"Press any key to exit..."
read
-n
1
-t
60
-p
"Press any key to exit..."
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