<commit_before>#!/bin/bash
while selection=$(grep "/dev/mmcblk" /proc/mounts | cut -f 2 -d " " | sed 's/\\040/ /g' | zenity --title="SD Card Mass Storage" --width="380" --height="200" --list --text="Enable mass storage" --column="Select card"); do
selection2=$(echo $selection | sed 's/ /\\\\040/g')
options=$(grep ${selection2} /proc/mounts | awk '{print $4}' | sed "s/,codepage=[A-Za-z0-9]*,/,/g" | sed 's/\\040/\\ /g' )
device=$(grep ${selection2} /proc/mounts | awk '{print substr($1,1,12)}')
device2=$(grep ${selection2} /proc/mounts | awk '{print $1}')

if umount $device
 
  then
    # switch to mass storage
   if lsmod | grep g_cdc &>/dev/null
	then
	echo Found g_cdc - removing...
	rmmod g_cdc
	ethernet=1
    fi
   modprobe g_file_storage file=$device stall=0
   zenity --title="Mass Storage Mode" --info --text="SD Card $selection is currently in Mass Storage Mode.\n\nClick on OK when you're finished with your data transfer\nand want to go back to normal mode."
    rmmod g_file_storage
    if [ $ethernet=1 ]; then
      echo Reloading g_cdc...
      modprobe g_cdc
    fi
    mount $device2 "$selection" -o $options<commit_msg>op_storage.sh: Added sleep after removal of g_cdc module<commit_after>#!/bin/bash
while selection=$(grep "/dev/mmcblk" /proc/mounts | cut -f 2 -d " " | sed 's/\\040/ /g' | zenity --title="SD Card Mass Storage" --width="380" --height="200" --list --text="Enable mass storage" --column="Select card"); do
selection2=$(echo $selection | sed 's/ /\\\\040/g')
options=$(grep ${selection2} /proc/mounts | awk '{print $4}' | sed "s/,codepage=[A-Za-z0-9]*,/,/g" | sed 's/\\040/\\ /g' )
device=$(grep ${selection2} /proc/mounts | awk '{print substr($1,1,12)}')
device2=$(grep ${selection2} /proc/mounts | awk '{print $1}')

if umount $device
 
  then
    # switch to mass storage
   if lsmod | grep g_cdc &>/dev/null
	then
	echo Found g_cdc - removing...
	rmmod g_cdc
	sleep 2
	ethernet=1
    fi
   modprobe g_file_storage file=$device stall=0
   zenity --title="Mass Storage Mode" --info --text="SD Card $selection is currently in Mass Storage Mode.\n\nClick on OK when you're finished with your data transfer\nand want to go back to normal mode."
    rmmod g_file_storage
    if [ $ethernet=1 ]; then
      echo Reloading g_cdc...
      modprobe g_cdc
    fi
    mount $device2 "$selection" -o $options
{'fraction_non_alphanumeric': 0.16937553464499572, 'fraction_numerical': 0.028656971770744225, 'mean_word_length': 3.2682481751824817, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5623652', 'n_tokens_mistral': 864, 'n_tokens_neox': 817, 'n_words': 260}