Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon Schneider committed Aug 14, 2015
2 parents 49bb509 + 503d66a commit 992dee9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
3 changes: 1 addition & 2 deletions iocage
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,10 @@ if [ "$1" == "help" ] ; then
exit 0
fi

if [ ! __readonly_cmd $1 -a "$(whoami)" != "root" ] ; then
if ! __readonly_cmd $1 && [ "$(whoami)" != "root" ] ; then
echo "* The $1 command needs root credentials!"
exit 1
fi

# Did not work when included as an OR below, workaround for that
if [ "$1" == "deactivate" ] ; then
shift
Expand Down
10 changes: 10 additions & 0 deletions lib/ioc-cmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
#!/bin/sh

# See whether given command is readonly
# and therefore doesn't need root credentials
__readonly_cmd () {
case "$1" in
defaults|df|get|list) return 0;;
esac

return 1
}

# Process command line options-------------------------
__parse_cmd () {
while [ $# -gt 0 ] ; do
Expand Down

0 comments on commit 992dee9

Please sign in to comment.