Skip to content

Commit

Permalink
better output; use sudo on rm
Browse files Browse the repository at this point in the history
  • Loading branch information
jflemer-ndp committed Jun 11, 2016
1 parent 46180a2 commit e1907a5
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions tile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ status() {

build() {
test -d /export/tile-"$1" || return 1
docker rm gen-"$1"
docker rm gen-"$1" 2>/dev/null
docker run -d \
--name gen-"$1" \
-v /export/scratch:/export/scratch \
Expand Down Expand Up @@ -57,7 +57,7 @@ stop() {
clean() {
docker stop gen gen-a gen-b tile-a tile-b
docker rm gen gen-a gen-b tile-a tile-b
rm -rf /export/build/* /export/build/.??* /export/scratch/*
sudo rm -rf /export/build/* /export/build/.??* /export/scratch/*
}

usage() {
Expand All @@ -84,9 +84,17 @@ EOF
}

case "$1" in
status|build|serve|stop|clean)
status)
"$@"
;;
build|serve|stop|clean)
"$@"
if [ $? = 0 ];then
echo OK
else
echo ERROR
fi
;;
*)
usage
exit 1
Expand Down

0 comments on commit e1907a5

Please sign in to comment.