Skip to main content
1) fix typo in cpmount script; 2) add execute permission step to protocol
Source Link
  1. Create file /usr/local/bin/cpmount

  2. Insert:

     #!/bin/bash
     if mountpoint -q /media/usb1
     then
        if mountpoint -q /media/usb2
        then
           if mountpoint -q /media/usb3
           then
              if mointpointmountpoint -1q /media/usb4
              then
                  echo "No mountpoints available!"
                  #You can add more if you need
              else
                  /usr/bin/pmount --umask 000 --noatime -w --sync $1 usb4
              fi
           else
              /usr/bin/pmount --umask 000 --noatime -w --sync $1 usb3
           fi
        else
           /usr/bin/pmount --umask 000 --noatime -w --sync $1 usb2
        fi
     else
        /usr/bin/pmount --umask 000 --noatime -w --sync $1 usb1
     fi
    
  3. Give execute permission to the (root) user: chmod u+x /usr/local/bin/cpmount

  4. Save and close

  1. Create file /usr/local/bin/cpmount

  2. Insert:

     #!/bin/bash
     if mountpoint -q /media/usb1
     then
        if mountpoint -q /media/usb2
        then
           if mountpoint -q /media/usb3
           then
              if mointpoint -1 /media/usb4
              then
                  echo "No mountpoints available!"
                  #You can add more if you need
              else
                  /usr/bin/pmount --umask 000 --noatime -w --sync $1 usb4
              fi
           else
              /usr/bin/pmount --umask 000 --noatime -w --sync $1 usb3
           fi
        else
           /usr/bin/pmount --umask 000 --noatime -w --sync $1 usb2
        fi
     else
        /usr/bin/pmount --umask 000 --noatime -w --sync $1 usb1
     fi
    
  3. Save and close

  1. Create file /usr/local/bin/cpmount

  2. Insert:

     #!/bin/bash
     if mountpoint -q /media/usb1
     then
        if mountpoint -q /media/usb2
        then
           if mountpoint -q /media/usb3
           then
              if mountpoint -q /media/usb4
              then
                  echo "No mountpoints available!"
                  #You can add more if you need
              else
                  /usr/bin/pmount --umask 000 --noatime -w --sync $1 usb4
              fi
           else
              /usr/bin/pmount --umask 000 --noatime -w --sync $1 usb3
           fi
        else
           /usr/bin/pmount --umask 000 --noatime -w --sync $1 usb2
        fi
     else
        /usr/bin/pmount --umask 000 --noatime -w --sync $1 usb1
     fi
    
  3. Give execute permission to the (root) user: chmod u+x /usr/local/bin/cpmount

  4. Save and close

Fixed typos indicated in comments.
Source Link
goldilocks
  • 60.1k
  • 17
  • 115
  • 230
  1. Create file /usr/local/bin/cpmount

  2. Insert:

     #!/bin/bash
     if mountpoint -q /media/usb1
     then
        if mountpoint -q /media/usb2
        then
           if mountpoint -q /media/usb3
           then
              if mointpoint -1 /media/usb4
              then
                  echo "No mountpoints available!"
                  #You can add more if you need
              else
                  /usr/bin/pmount --umask 00000 --noatime -rw --sync $1 usb4
              fi
           else
              /usr/bin/pmount --umask 000 --noatime -rw --sync $1 usb3
           fi
        else
           /usr/bin/pmount --umask 000 --noatime -rw --sync $1 usb2
        fi
     else
        /usr/bin/pmount --umask 000 --noatime -rw --sync $1 usb1
     fi
    
  3. Save and close

  1. Create file /usr/local/bin/cpmount

  2. Insert:

     #!/bin/bash
     if mountpoint -q /media/usb1
     then
        if mountpoint -q /media/usb2
        then
           if mountpoint -q /media/usb3
           then
              if mointpoint -1 /media/usb4
              then
                  echo "No mountpoints available!"
                  #You can add more if you need
              else
                  /usr/bin/pmount --umask 00 -noatime -r --sync $1 usb4
              fi
           else
              /usr/bin/pmount --umask 000 --noatime -r --sync $1 usb3
           fi
        else
           /usr/bin/pmount --umask 000 --noatime -r --sync $1 usb2
        fi
     else
        /usr/bin/pmount --umask 000 --noatime -r --sync $1 usb1
     fi
    
  3. Save and close

  1. Create file /usr/local/bin/cpmount

  2. Insert:

     #!/bin/bash
     if mountpoint -q /media/usb1
     then
        if mountpoint -q /media/usb2
        then
           if mountpoint -q /media/usb3
           then
              if mointpoint -1 /media/usb4
              then
                  echo "No mountpoints available!"
                  #You can add more if you need
              else
                  /usr/bin/pmount --umask 000 --noatime -w --sync $1 usb4
              fi
           else
              /usr/bin/pmount --umask 000 --noatime -w --sync $1 usb3
           fi
        else
           /usr/bin/pmount --umask 000 --noatime -w --sync $1 usb2
        fi
     else
        /usr/bin/pmount --umask 000 --noatime -w --sync $1 usb1
     fi
    
  3. Save and close

Removed false information
Source Link
pauliucxz
  • 489
  • 1
  • 3
  • 10
  1. Install pmount and initscripts if not installed sudo apt-get install pmount initscripts
  2. This script mounts drives to /media/usb*, so make sure those folders aren't occupied. If you want a cleaner look, don't create any folders.
  1. Install pmount and initscripts if not installed sudo apt-get install pmount initscripts
  2. This script mounts drives to /media/usb*, so make sure those folders aren't occupied. If you want a cleaner look, don't create any folders.
  1. Install pmount if not installed sudo apt-get install pmount
  2. This script mounts drives to /media/usb*, so make sure those folders aren't occupied. If you want a cleaner look, don't create any folders.
Source Link
pauliucxz
  • 489
  • 1
  • 3
  • 10
Loading