Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
create-iso
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
le6
create-iso
Commits
00b3ce20
Commit
00b3ce20
authored
Apr 23, 2018
by
Lucas Sulzbach
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SCRUM#498
: Improve argument parsing and help
parent
0acc12fa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
16 deletions
+36
-16
monta_image.sh
monta_image.sh
+36
-16
No files found.
monta_image.sh
View file @
00b3ce20
...
...
@@ -20,30 +20,50 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
_HELP
=
false
_DIST
=
"nodistro"
_ARCH
=
"amd64"
if
[
"
$(
id
-u
)
"
!=
"0"
]
;
then
echo
You must have more power to run this script
exit
-1
while
true
;
do
case
"
$1
"
in
-h
|
--help
)
_HELP
=
true
;
shift
;;
-d
|
--distro
)
_DIST
=
$2
;
shift
;
shift
;;
-a
|
--arch
)
_ARCH
=
$2
;
shift
;
shift
;;
-
*
)
echo
"Unrecognized option. Try with --help."
;
exit
1
;;
*
)
break
;;
esac
done
if
[
${
_HELP
}
=
true
]
;
then
echo
"Usage: sudo
$0
[OPTION] [ARGUMENT]..."
echo
""
echo
"Examples:"
echo
" sudo
$0
--distro le6/testing # Generate default arch (amd64) le6 iso image"
echo
" sudo
$0
-d le6/testing -a i386 # Generate i386 architecture le6 iso image"
echo
""
echo
"Options:"
echo
" -h, --help Show this help list"
echo
" -d, --distro [DIST] Select iso image's distro"
echo
" -a, --arch [amd64 | i386] Select iso image's architecture"
exit
2
fi
if
[
$#
-lt
1
]
||
[
$#
-gt
2
]
;
then
echo
"Usage:
$0
[dist] [arch]"
echo
"
Argument [arch] is optional. Default architecture: amd64
"
if
[
${
_DIST
}
=
"nodistro"
]
;
then
echo
"
No distro. Try with --help.
"
exit
1
fi
if
[
"
$1
"
==
'--help'
]
;
then
echo
"Usage:
$0
[dist] [arch]"
echo
"Argument [arch] is optional. Default architecture: amd64"
exit
2
fi
_DIST
=
$1
if
[
${
_ARCH
}
!=
"amd64"
-a
${
_ARCH
}
!=
"i386"
]
;
then
echo
"Unrecognized architecture. Try with --help."
exit
1
fi
if
[
$#
-ne
2
]
;
then
_ARCH
=
"amd64"
else
_ARCH
=
$2
if
[
"
$(
id
-u
)
"
!=
"0"
]
;
then
echo
"You must have more power to run this script. Are you root?"
exit
-1
fi
export
PREFIX
=
$(
pwd
)
source
${
PREFIX
}
/conf/
$_DIST
/create-iso.conf
\
||
log ERROR
"configuration file not found for dist:
\"
${
_DIST
}
\"
"
...
...
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