def mount(pw = nil, access = :ro)
      return @mountpoint if mounted?
      access = :ro unless access == :rw

      password = if pw == :prompt
        JSS.prompt_for_password "Enter the password for the #{access} user '#{access == :ro ? @read_only_username : @read_write_username }':"
      elsif pw.is_a?(Symbol) and pw.to_s.start_with?('stdin')
        pw.to_s =~ /^stdin(\d+)$/
        line = $1
        line ||= 2
        JSS.stdin line
      else
        pw
      end

      pwok = check_pw(access, password)
      unless pwok
        msg = pwok.nil? ? "No #{access} password set in the JSS" : "Incorrect password for #{access} account"
        raise JSS::InvalidDataError, msg
      end

      username = access == :ro ? @read_only_username : @read_write_username

      safe_pw = CGI.escape password

      @mount_url = "#{@connection_type.downcase}://#{username}:#{safe_pw}@#{@ip_address}/#{@share_name}"
      @mnt_cmd = case @connection_type.downcase
        when 'smb' then '/sbin/mount_smbfs'
        when 'afp' then '/sbin/mount_afp'
        else raise "Can't mount distribution point #{@name}: no known connection type."
      end

      @mountpoint.mkpath

      mount_out = `#{@mnt_cmd} -o '#{MOUNT_OPTIONS}' '#{@mount_url}' '#{@mountpoint}' 2>&1`
      if $?.exitstatus == 0 and @mountpoint.mountpoint?
      #if system @mnt_cmd.to_s, *['-o', MOUNT_OPTIONS, @mount_url, @mountpoint.to_s]
        @mounted = access
      else
        @mountpoint.rmdir if @mountpoint.directory?
        @mounted = nil
        raise JSS::FileServiceError, "Can't mount #{@ip_address}: #{mount_out}"
      end
      return @mountpoint
    end
def mount(pw = nil, access = :ro)
      return @mountpoint if mounted?
      access = :ro unless access == :rw

      password = if pw == :prompt
        JSS.prompt_for_password "Enter the password for the #{access} user '#{access == :ro ? @read_only_username : @read_write_username }':"
      elsif pw.is_a?(Symbol) and pw.to_s.start_with?('stdin')
        pw.to_s =~ /^stdin(\d+)$/
        line = $1
        line ||= 2
        JSS.stdin line
      else
        pw
      end

      pwok = check_pw(access, password)
      unless pwok
        msg = pwok.nil? ? "No #{access} password set in the JSS" : "Incorrect password for #{access} account"
        raise JSS::InvalidDataError, msg
      end

      username = access == :ro ? @read_only_username : @read_write_username

      safe_pw = CGI.escape password

      @mount_url = "#{@connection_type.downcase}://#{username}:#{safe_pw}@#{@ip_address}/#{@share_name}"
      @mnt_cmd = case @connection_type.downcase
        when 'smb' then '/sbin/mount_smbfs'
        when 'afp' then '/sbin/mount_afp'
        else raise "Can't mount distribution point #{@name}: no known connection type."
      end

      @mountpoint.mkpath

      mount_out = `#{@mnt_cmd} -o '#{MOUNT_OPTIONS}' '#{@mount_url}' '#{@mountpoint}' 2>&1`
      if $?.exitstatus == 0 and @mountpoint.mountpoint?
      #if system @mnt_cmd.to_s, *['-o', MOUNT_OPTIONS, @mount_url, @mountpoint.to_s]
        @mounted = access
      else
        @mountpoint.rmdir if @mountpoint.directory?
        @mounted = nil
        raise JSS::FileServiceError, "Can't mount #{@ip_address}: #{mount_out}"
      end
      return @mountpoint
    end
Mount this distribution point locally.

 @param pw[String,Symbol] the read-only or read-write password for this DistributionPoint
   If :prompt, the user is promted on the commandline to enter the password for the :user.
   If :stdin#, the password is read from a line of std in represented by the digits at #,
   so :stdin3 reads the passwd from the third line of standard input. defaults to line 2,
   if no digit is supplied. see {JSS.stdin}

 @param access[Symbol] how to mount the DistributionPoint, and which password to expect.
  :ro (or anything else) = read-only, :rw = read-write

 @return [Pathname] the mountpoint.