Changeset 1744

Show
Ignore:
Timestamp:
11/28/06 01:49:12 (2 years ago)
Author:
anarcat
Message:

use absolute path otherwise this fails on install, see #998

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • alternc/trunk/src/quota_get.sh

    r891 r1744  
    22. /etc/alternc/local.sh 
    33 
    4 DATA_PART=`df ${ALTERNC_LOC} 2>/dev/null | awk '/^\// { print $1 }'` 
     4AWK=/usr/bin/awk 
     5DF=/bin/df 
     6SED=/bin/sed 
     7MOUNT=/bin/mount 
     8QUOTA=/usr/bin/quota 
     9GREP=/bin/grep 
     10 
     11DATA_PART=`$DF ${ALTERNC_LOC} 2>/dev/null | $AWK '/^\// { print $1 }'` 
    512 
    613# quota will give over NFS will print the partition using the full NFS name 
    714# (e.g. 10.0.0.1:/var/alternc) so we need to lookup first with mount 
    815# to convert DATA_PART if needed. 
    9 QUOTA_PART=`mount | sed -n -e "s,\([^ ]*\) on ${DATA_PART} type nfs.*,\1,p"` 
     16QUOTA_PART=`$MOUNT | $SED -n -e "s,\([^ ]*\) on ${DATA_PART} type nfs.*,\1,p"` 
    1017if [ -z "$QUOTA_PART" ]; then 
    1118    QUOTA_PART="$DATA_PART" 
     
    1623PART_LEN=`echo -n "$QUOTA_PART" | wc -c` 
    1724if [ "$PART_LEN" -gt 15 ]; then 
    18     quota -g "$1" | 
    19        sed -n -e "\\;${QUOTA_PART};,+1s/ *\([0-9]*\) .*/\1/p" | 
    20        grep -v '^$' 
    21     quota -g "$1" | 
    22        sed -n -e "\\;${QUOTA_PART};,+1s/ *[0-9]* *\([0-9]*\) .*/\1/p" | 
    23        grep -v '^$' 
     25    $QUOTA -g "$1" | 
     26       $SED -n -e "\\;${QUOTA_PART};,+1s/ *\([0-9]*\) .*/\1/p" | 
     27       $GREP -v '^$' 
     28    $QUOTA -g "$1" | 
     29       $SED -n -e "\\;${QUOTA_PART};,+1s/ *[0-9]* *\([0-9]*\) .*/\1/p" | 
     30       $GREP -v '^$' 
    2431else 
    25     quota -g "$1" | awk /${QUOTA_PART//\//\\\/}/\ {print\ '$2'} 
    26     quota -g "$1" | awk /${QUOTA_PART//\//\\\/}/\ {print\ '$3'} 
     32    $QUOTA -g "$1" | $AWK /${QUOTA_PART//\//\\\/}/\ {print\ '$2'} 
     33    $QUOTA -g "$1" | $AWK /${QUOTA_PART//\//\\\/}/\ {print\ '$3'} 
    2734fi 
    2835