diff options
author | Olivier Blin <oblin@mandriva.com> | 2007-07-05 14:52:06 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2007-07-05 14:52:06 +0000 |
commit | a4fcd7c7353cbf03bd6d5304314bfcdfeca5c03c (patch) | |
tree | a6f869decfe494cc23d9f04fc4a3ad5a871bb3ff | |
parent | 3f6173e1fc72a1627a6767de156ed0a5cb5e4a3c (diff) | |
download | drakx-a4fcd7c7353cbf03bd6d5304314bfcdfeca5c03c.tar drakx-a4fcd7c7353cbf03bd6d5304314bfcdfeca5c03c.tar.gz drakx-a4fcd7c7353cbf03bd6d5304314bfcdfeca5c03c.tar.bz2 drakx-a4fcd7c7353cbf03bd6d5304314bfcdfeca5c03c.tar.xz drakx-a4fcd7c7353cbf03bd6d5304314bfcdfeca5c03c.zip |
introduce has_label() function
-rw-r--r-- | rescue/Flash/scripts/rescue_common | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/rescue/Flash/scripts/rescue_common b/rescue/Flash/scripts/rescue_common index d09a3de1c..676a955da 100644 --- a/rescue/Flash/scripts/rescue_common +++ b/rescue/Flash/scripts/rescue_common @@ -1,22 +1,31 @@ #!/bin/bash function detect_version() { + if has_label Share; then + version="1.0" + else + version="1.05" + fi +} + +function has_label() { + local _label _tmpdir + _label=$1 _tmpdir="/tmp/$$" mkdir -p $_tmpdir nash --force > /dev/null 2>&1 <<EOF -mount -t vfat LABEL=Share $_tmpdir +mount -t vfat LABEL=$_label $_tmpdir EOF - if [ $? -eq 0 ]; then - version="1.0" - else - version="1.05" - fi - + + rc=$? + umount $_tmpdir 2> /dev/null rmdir $_tmpdir 2> /dev/null + + return $rc } function check_vendor() { |