<commit_before>#!/bin/sh

echo add_ftp_service.sh
TS=` date +%Y%m%d%H%M%S`
mkdir -p /var/log/ftp/
echo $TS: $SSH_ORIGINAL_COMMAND >> /var/log/ftp/add.log

service_hash=`echo  $SSH_ORIGINAL_COMMAND | awk '{print $2}'`
echo $service_hash
new=`echo $service_hash | sed "/^:/s///" |  sed "/:$/s///"`

service_hash=$new


n=1

fcnt=`echo $service_hash| grep -o : |wc -l`

fcnt=`expr $fcnt + 1`

        while test $fcnt -ge $n
        do
                nvp="`echo $service_hash |cut -f$n -d:`"
                n=`expr $n + 1`
                name=`echo $nvp |cut -f1 -d=`
                value=`echo $nvp |cut -f2 -d=`
                if test ${#name} -gt 0
                	then
                		export $name="$value"
                	fi
        done
                
         if test "$rw_access" = "true"
          then
          	access="rw"
          else
          	access="ro"
        fi
     
        pass=`/bin/echo -n "$password" | openssl dgst -binary -md5 | openssl enc -base64`
        sql="insert into users (userid,passwd,gid,ftphomedir,use_count) values('$username','{md5}$pass',${ftp_gid},'/ftp/$access/$parent_engine/$volume/$folder/',0)"
        
        . /home/auth/.dbenv
        echo $sql | mysql -h $dbhost -u $dbuser --password=$dbpasswd $dbname
        echo $sql   mysql -h $dbhost -u $dbuser --password=$dbpasswd $dbname
        
           sql="update users set use_count = 1 + use_count,ftphomedir='/ftp/$access/$parent_engine/$volume/$folder/' where userid = '$username';"  
               
         echo $sql | mysql -h $dbhost -u $dbuser --password=$dbpasswd $dbname
         echo $sql   mysql -h $dbhost -u $dbuser --password=$dbpasswd $dbname<commit_msg>handl new vlume prefixs that allow for multiple volumes<commit_after>#!/bin/sh

echo add_ftp_service.sh
TS=` date +%Y%m%d%H%M%S`
mkdir -p /var/log/ftp/
echo $TS: $SSH_ORIGINAL_COMMAND >> /var/log/ftp/add.log

service_hash=`echo  $SSH_ORIGINAL_COMMAND | awk '{print $2}'`
echo $service_hash
new=`echo $service_hash | sed "/^:/s///" |  sed "/:$/s///"`

service_hash=$new


n=1

fcnt=`echo $service_hash| grep -o : |wc -l`

fcnt=`expr $fcnt + 1`

        while test $fcnt -ge $n
        do
                nvp="`echo $service_hash |cut -f$n -d:`"
                n=`expr $n + 1`
                name=`echo $nvp |cut -f1 -d=`
                value=`echo $nvp |cut -f2 -d=`
                if test ${#name} -gt 0
                	then
                		export $name="$value"
                	fi
        done
                
         if test "$rw_access" = "true"
          then
          	access="rw"
          else
          	access="ro"
        fi
     
     if test $volume = '/home/app'
      then
      		 volume='_home_app'
      else
      		volume="_home_fs_"$volume
     fi
        pass=`/bin/echo -n "$password" | openssl dgst -binary -md5 | openssl enc -base64`
        sql="insert into users (userid,passwd,gid,ftphomedir,use_count) values('$username','{md5}$pass',${ftp_gid},'/ftp/$access/$parent_engine/$volume/$folder/',0)"
        
        . /home/auth/.dbenv
        echo $sql | mysql -h $dbhost -u $dbuser --password=$dbpasswd $dbname
        echo $sql   mysql -h $dbhost -u $dbuser --password=$dbpasswd $dbname
        
           sql="update users set use_count = 1 + use_count,ftphomedir='/ftp/$access/$parent_engine/$volume/$folder/' where userid = '$username';"  
               
         echo $sql | mysql -h $dbhost -u $dbuser --password=$dbpasswd $dbname
         echo $sql   mysql -h $dbhost -u $dbuser --password=$dbpasswd $dbname
{'fraction_non_alphanumeric': 0.15343317321277197, 'fraction_numerical': 0.00734670810963549, 'mean_word_length': 1.8780487804878048, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '955463', 'n_tokens_mistral': 1295, 'n_tokens_neox': 1221, 'n_words': 298}