Commit 304143a8 by Dwight Engen Committed by Serge Hallyn

lxc-shutdown: fix lxc_path variable

parent 8d06bd13
...@@ -41,7 +41,7 @@ alarm() { ...@@ -41,7 +41,7 @@ alarm() {
dolxcstop() dolxcstop()
{ {
echo "Calling lxc-stop on $lxc_name" echo "Calling lxc-stop on $lxc_name"
lxc-stop -n $lxc_name -P "$lxcpath" lxc-stop -n $lxc_name -P "$lxc_path"
exit 0 exit 0
} }
...@@ -87,7 +87,7 @@ while [ $# -gt 0 ]; do ...@@ -87,7 +87,7 @@ while [ $# -gt 0 ]; do
;; ;;
-P|--lxcpath) -P|--lxcpath)
optarg_check $opt "$1" optarg_check $opt "$1"
lxcpath=$1 lxc_path=$1
dowait=1 dowait=1
shift shift
;; ;;
...@@ -113,8 +113,8 @@ if [ -z "$lxc_name" ]; then ...@@ -113,8 +113,8 @@ if [ -z "$lxc_name" ]; then
exit 1 exit 1
fi fi
if [ ! -d "$lxcpath" ]; then if [ ! -d "$lxc_path" ]; then
echo "$lxcpath: no such directory" echo "$lxc_path: no such directory"
exit 1 exit 1
fi fi
...@@ -126,7 +126,7 @@ fi ...@@ -126,7 +126,7 @@ fi
which lxc-info > /dev/null 2>&1 || { echo "lxc-info not found."; exit 1; } which lxc-info > /dev/null 2>&1 || { echo "lxc-info not found."; exit 1; }
which lxc-wait > /dev/null 2>&1 || { echo "lxc-wait not found."; exit 1; } which lxc-wait > /dev/null 2>&1 || { echo "lxc-wait not found."; exit 1; }
pid=`lxc-info -n $lxc_name -P "$lxcpath" -p 2>/dev/null | awk '{ print $2 }'` pid=`lxc-info -n $lxc_name -P "$lxc_path" -p 2>/dev/null | awk '{ print $2 }'`
if [ "$pid" = "-1" ]; then if [ "$pid" = "-1" ]; then
echo "$lxc_name is not running" echo "$lxc_name is not running"
exit 1 exit 1
...@@ -149,7 +149,7 @@ if [ $timeout != "-1" ]; then ...@@ -149,7 +149,7 @@ if [ $timeout != "-1" ]; then
alarmpid=$! alarmpid=$!
fi fi
while ! lxc-info -n $lxc_name -P "$lxcpath" --state-is STOPPED; do while ! lxc-info -n $lxc_name -P "$lxc_path" --state-is STOPPED; do
sleep 1 sleep 1
done done
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment