OSDN Git Service

Fix the command path
authorTAMUKI Shoichi <tamuki@linet.gr.jp>
Sun, 16 Mar 2014 07:11:58 +0000 (16:11 +0900)
committerHideyuki Niwa <niwa.hideyuki@jp.fujitsu.com>
Mon, 17 Mar 2014 00:18:55 +0000 (09:18 +0900)
- Fix the command path to /bin for bash, rm and {,u}mount
- Remove trailing whitespace

Signed-off-by: TAMUKI Shoichi <tamuki@linet.gr.jp>
lxcf/cmd/lxcf
lxcf/lib/lxcf-deploy
lxcf/lib/lxcf-erase
lxcf/lib/lxcf-maintenance
lxcf/lib/lxcf-update1
lxcf/lib/lxcf-update2

index 1238922..4ddc6ac 100755 (executable)
@@ -5,15 +5,15 @@
 # modify it under the terms of the GNU General Public License
 # as published by the Free Software Foundation; version 2
 # of the License.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 # 02110-1301, USA.
 
 # check root
@@ -36,11 +36,10 @@ if [ $# -eq 0 ] ; then
   echo "     Type:  'helpcmd' for help with commands"
   echo "            'exit' or '^d' to quit"
   echo
-  PS1="LXCF # " /usr/bin/bash
+  PS1="LXCF # " /bin/bash
   exit 0
-else 
+else
   exec $*
 fi
 
 exit 0
-  
index beb30c7..c09ca54 100755 (executable)
@@ -5,15 +5,15 @@
 # modify it under the terms of the GNU General Public License
 # as published by the Free Software Foundation; version 2
 # of the License.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 # 02110-1301, USA.
 
 # check root
@@ -49,7 +49,7 @@ check_filename() {
     exit 1
   fi
   if echo $1 | egrep '\.\.'  >& /dev/null ; then
-    echo "error:" "path" $1 "contains '..'" 
+    echo "error:" "path" $1 "contains '..'"
     exit 1
   fi
 }
@@ -67,7 +67,7 @@ if [ ${FLG_D} = 1 ] && [ ${FLG_F} = 0 ] ; then
                continue ;;
        [Nn]|[Nn][Oo])
                exit 1 ;;
-       *) 
+       *)
                exit 1;;
        esac
 fi
@@ -102,7 +102,7 @@ lxcf_deploy_delete1() {
 
        for j in ${FILES}
        do
-               /usr/bin/rm -rf ${DISTROOT}$PWD/$j
+               /bin/rm -rf ${DISTROOT}$PWD/$j
                echo "delete : " $PWD/$j
        done;
        echo
@@ -127,4 +127,3 @@ if [ ${FLG_D} = 1 ] ; then
 fi
 
 exit 0
-
index ad8f366..0edd813 100755 (executable)
@@ -91,14 +91,14 @@ lxcf_erase1() {
   if [ -L /opt/lxcf/${LXCNAME} ] ; then
        FILEPATH=`ls -l /opt/lxcf/${LXCNAME} | awk '{n=split($0,a," ");print a[n];}'`
        echo "erase" $FILEPATH
-       /usr/bin/rm -rf $FILEPATH
+       /bin/rm -rf $FILEPATH
   fi
 
-  /usr/bin/rm -rf /opt/lxcf/${LXCNAME}
+  /bin/rm -rf /opt/lxcf/${LXCNAME}
 
   echo "erase /etc/lxcf/rsc/"${LXCNAME}
 
-  /usr/bin/rm -rf /etc/lxcf/rsc/${LXCNAME}
+  /bin/rm -rf /etc/lxcf/rsc/${LXCNAME}
 
   /usr/lib/lxcf/lxcf-erase-setup ${LXCNAME}
 
index a0bfea6..0576314 100755 (executable)
@@ -1,19 +1,19 @@
 #!/bin/sh
-# copyright (C) 2013 FUJITSU LIMITED All Rights Reserved
+# copyright (C) 2013-2014 FUJITSU LIMITED All Rights Reserved
 
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License
 # as published by the Free Software Foundation; version 2
 # of the License.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 # 02110-1301, USA.
 
 # check root
@@ -32,12 +32,12 @@ while getopts c:m:i:h OPT
 do
   case $OPT in
     "c" )
-       # set CPU 
+       # set CPU
        echo -n 100000 > ${CPU_LXCFMAINTENANCE}/cpu.cfs_period_us;
        echo -n  `expr $OPTARG \* 1000` > ${CPU_LXCFMAINTENANCE}/cpu.cfs_quota_us;
     ;;
     "m" )
-       #set MEMORY 
+       #set MEMORY
        echo -n `expr $OPTARG \* 1024 \* 1024` > ${MEM_LXCFMAINTENANCE}/memory.limit_in_bytes;
     ;;
     "i" )
@@ -69,10 +69,9 @@ echo
 
 # exec command
 if [ $# -eq 0 ] ; then
-       PS1="lxcf-maintenance # "  /usr/bin/bash
+       PS1="lxcf-maintenance # " /bin/bash
 else
        . $*
 fi
 
 exit $?
-
index 102986d..d8684b1 100755 (executable)
@@ -5,15 +5,15 @@
 # modify it under the terms of the GNU General Public License
 # as published by the Free Software Foundation; version 2
 # of the License.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 # 02110-1301, USA.
 
 # check root
@@ -56,8 +56,8 @@ LXCMODEL=`awk '{ if (NF==2) print $2 }' ${PREFIX}/etc/lxcf/container_name `
 if [ x${LXCMODEL} = x"joint" ] ; then
   # mount dummy /usr
   if [ ${LXCMODEL} = "joint" ] ; then
-       /usr/bin/mount --bind ${WORKUSR} ${PREFIX}/usr
-       trap '/usr/bin/umount -f ${PREFIX}/usr >& /dev/null' 0
+       /bin/mount --bind ${WORKUSR} ${PREFIX}/usr
+       trap '/bin/umount -f ${PREFIX}/usr >& /dev/null' 0
   fi
 fi
 
@@ -65,4 +65,3 @@ fi
 chroot ${PREFIX} /usr/lib/lxcf/lxcf-update2 ${LXCNAME} ${PWD} ${UPDATECMD}
 
 exit $?
-
index 443940a..2eddd17 100755 (executable)
@@ -1,19 +1,19 @@
 #!/bin/sh
-# copyright (C) 2013 FUJITSU LIMITED All Rights Reserved
+# copyright (C) 2013-2014 FUJITSU LIMITED All Rights Reserved
 
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License
 # as published by the Free Software Foundation; version 2
 # of the License.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 # 02110-1301, USA.
 
 # check root
@@ -37,8 +37,8 @@ UPDATECMD=$*
 PREFIX=/opt/lxcf/${LXCNAME}
 
 # mount /proc
-/usr/bin/mount -t proc proc /proc
-trap '/usr/sbin/umount -f /proc >& /dev/null' 0
+/bin/mount -t proc proc /proc
+trap '/bin/umount -f /proc >& /dev/null' 0
 
 # cd current-path
 mkdir -p ${LXCPWD}
@@ -59,7 +59,6 @@ echo
 echo "###" $LXCNAME "end:" ${UPDATECMD} "###"
 
 # umount /proc
-/usr/bin/umount -f /proc
+/bin/umount -f /proc
 
 exit ${UPDATE_RESULT}
-