Keraxel

TrueCrypt mounting script

Jan 24th, 2012
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.65 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. #######################
  4. # by Keraxel          #
  5. # http://keraxel.net  #
  6. # License: GNU/GPL v3 #
  7. #######################
  8.  
  9.     if [ $1 ]; then
  10.         if [ $1 = "--mount" ] || [ $1 = "-m" ]
  11.         then
  12.             if [ $2 ]
  13.             then
  14.                 if [ $2 = "internal" ]
  15.                 then
  16.                     echo "Mounting internal partition..."
  17.                     truecrypt --text --slot=1 --keyfiles=/home/dupa/what3vr.sprld -p "" /dev/sda5 /media/truecrypt1
  18.                 elif [ $2 = "external" ]
  19.                 then
  20.                     echo "Mounting external HDD..."
  21.                     truecrypt --text --slot=2 --keyfiles=/home/dupa/what3vr.sprld -p "" /dev/sdb1 /media/truecrypt2
  22.                 else
  23.                     echo "Mounting internal partition and external HDD..."
  24.                     truecrypt --text --slot=1 --keyfiles=/home/dupa/what3vr.sprld -p "" /dev/sda5 /media/truecrypt1
  25.                     truecrypt --text --slot=2 --/home/dupa/what3vr.sprld -p "" /dev/sdb1 /media/truecrypt2
  26.                 fi
  27.             fi
  28.         elif [ $1 = "--dismount" ] || [ $1 = "-d" ]
  29.         then
  30.             if [ $2 ]
  31.             then
  32.                 if [ $2 = "internal" ]
  33.                 then
  34.                     echo "Dismounting internal partition..."
  35.                     truecrypt --text --force -d /dev/sda5
  36.                 elif [ $2 = "external" ]
  37.                 then
  38.                     echo "Dismounting external HDD..."
  39.                     truecrypt --text -d --force /dev/sdb1
  40.                 else
  41.                     echo "Dismounting internal partition and external HDD..."
  42.                     truecrypt --text -d --force /dev/sda5
  43.                     truecrypt --text -d --force /dev/sdb1
  44.                 fi
  45.             fi
  46.         else
  47. echo "
  48. Usage:
  49. option          description
  50. --mount <drive>     Mounts a <drive>
  51. -m <drive>
  52. --dismount <drive>  Dismounts a <drive>
  53. -d <drive>
  54.  
  55. Drives:
  56. drive       description
  57. internal    Internal HDD Partition
  58. external    External HDD
  59. "
  60.         fi
  61.     else
  62.         echo "Use --help for information about usage."
  63.     fi
Advertisement
Add Comment
Please, Sign In to add comment