/[baselayout]/branches/rc-scripts-1_6/sbin/functions.sh
Gentoo

Diff of /branches/rc-scripts-1_6/sbin/functions.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 768 Revision 769
634is_uml_sys() { 634is_uml_sys() {
635 grep -q 'UML' /proc/cpuinfo &> /dev/null 635 grep -q 'UML' /proc/cpuinfo &> /dev/null
636 return $? 636 return $?
637} 637}
638 638
639# bool is_in_fstab(path) 639# bool get_mount_fstab(path)
640# 640#
641# return 0 if path is listed in /etc/fstab 641# return the parameters to pass to the mount command generated from fstab
642# 642#
643# EXAMPLE: if is_in_fstab /proc ; then ... 643# EXAMPLE: cmd=$( get_mount_fstab /proc )
644# cmd=${cmd:--t proc none /proc}
645# mount -n ${cmd}
644# 646#
645is_in_fstab() { 647get_mount_fstab() {
646 [ -n "$(awk '($2 ~ /^'${*//\//\\/}'$/) { print }' /etc/fstab)" ] 648 awk '$1 ~ "^#" { next } $2 == "'$*'" { print "-t "$3,"-o "$4,$1,$2 }' /etc/fstab
647} 649}
648 650
649# bool is_older_than(reference, files/dirs to check) 651# bool is_older_than(reference, files/dirs to check)
650# 652#
651# return 0 if any of the files/dirs are newer than 653# return 0 if any of the files/dirs are newer than

Legend:
Removed from v.768  
changed lines
  Added in v.769

  ViewVC Help
Powered by ViewVC 1.1.20