Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
f910f092
Commit
f910f092
authored
Nov 26, 2012
by
Natanael Copa
Committed by
Stéphane Graber
Nov 27, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lxc-setcap: use POSIX shell instead of bash
Avoid getopt --longoptions Signed-off-by:
Natanael Copa
<
ncopa@alpinelinux.org
>
Acked-by:
Stéphane Graber
<
stgraber@ubuntu.com
>
parent
b45a7402
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
12 deletions
+20
-12
lxc-setcap.in
src/lxc/lxc-setcap.in
+20
-12
No files found.
src/lxc/lxc-setcap.in
View file @
f910f092
#!/bin/
ba
sh
#!/bin/sh
#
#
# lxc: linux Container library
# lxc: linux Container library
...
@@ -81,31 +81,39 @@ lxc_dropcaps()
...
@@ -81,31 +81,39 @@ lxc_dropcaps()
chmod
0755 @LXCPATH@
chmod
0755 @LXCPATH@
}
}
shortoptions
=
'hd'
usage_err
()
{
longoptions
=
'help'
[
-n
"
$1
"
]
&&
echo
"
$1
"
>
&2
getopt
=
$(
getopt
-o
$shortoptions
--longoptions
$longoptions
--
"
$@
"
)
if
[
$?
!=
0
]
;
then
usage
usage
exit
1
exit
1
fi
}
eval set
--
"
$getopt
"
optarg_check
()
{
if
[
-z
"
$2
"
]
;
then
usage_err
"option '
$1
' requires an argument"
fi
}
while
true
;
do
while
[
$#
-gt
0
]
;
do
case
"
$1
"
in
opt
=
"
$1
"
shift
case
"
$opt
"
in
-d
)
-d
)
LXC_DROP_CAPS
=
"yes"
LXC_DROP_CAPS
=
"yes"
shift
;;
;;
-h
|
--help
)
-h
|
--help
)
help
help
exit
0
exit
0
;;
;;
--
)
--
)
shift
break
break
;;
;;
-?
)
usage_err
"unknown option '
$opt
'"
;;
-
*
)
# split opts -abc into -a -b -c
set
--
$(
echo
"
${
opt
#-
}
"
|
sed
's/\(.\)/ -\1/g'
)
"
$@
"
;;
*
)
*
)
usage
usage
exit
1
exit
1
...
...
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