Browse Source

Remove curl access to indexthemes

prieto 8 years ago
parent
commit
7fa8dee106
2 changed files with 4 additions and 35 deletions
  1. 0
    4
      progs/create_datas
  2. 4
    31
      progs/create_datas.sh

+ 0
- 4
progs/create_datas View File

@@ -11,10 +11,6 @@ do
11 11
     COLPUBLI=""
12 12
     COLT=$(lenmax=100;wcount=5; rlenmax=$(expr $lenmax - 1); echo $(shuf /usr/share/dict/words | head -n $wcount | tr -s "\n" " ") | sed -E "s/^(.{$rlenmax}).*$/\1/") 
13 13
     curl -A "Mozilla/5.0" -L -s -d "field_input_title=$COLT&field_input_publications=$COLPUBLI&classname=Collection" http://$host/$instance/admin/create?classname=Collection
14
-    ITTHM="themetest"
15
-    ITNAME=$(lenmax=30;wcount=3; rlenmax=$(expr $lenmax - 1); echo $(shuf /usr/share/dict/words | head -n $wcount | tr -s "\n" " ") | sed -E "s/^(.{$rlenmax}).*$/\1/")
16
-    ITVAL=$(lenmax=10;wcount=1; rlenmax=$(expr $lenmax - 1); echo $(shuf /usr/share/dict/words | head -n $wcount | tr -s "\n" " ") | sed -E "s/^(.{$rlenmax}).*$/\1/")
17
-    curl -A "Mozilla/5.0" -L -s -d "field_input_theme=$ITTHM&field_input_name=$ITNAME&field_input_value=$ITVAL&classname=Indextheme" http://$host/$instance/admin/create?classname=Indextheme
18 14
     LN=$(lenmax=20;wcount=1; rlenmax=$(expr $lenmax - 1); echo $(shuf /usr/share/dict/words | head -n $wcount | tr -s "\n" " ") | sed -E "s/^(.{$rlenmax}).*$/\1/")
19 15
     FN=$(lenmax=20;wcount=1; rlenmax=$(expr $lenmax - 1); echo $(shuf /usr/share/dict/words | head -n $wcount | tr -s "\n" " ") | sed -E "s/^(.{$rlenmax}).*$/\1/")
20 16
     curl -A "Mozilla/5.0" -L -s -d "field_input_lastname=$LN&field_input_firstname=$FN&classname=Person" http://$host/$instance/admin/create?classname=Person

+ 4
- 31
progs/create_datas.sh View File

@@ -11,10 +11,6 @@ do
11 11
     COLPUBLI=""
12 12
     COLT=$(lenmax=100;wcount=5; rlenmax=$(expr $lenmax - 1); echo $(shuf /usr/share/dict/words | head -n $wcount | tr -s "\n" " ") | sed -E "s/^(.{$rlenmax}).*$/\1/") 
13 13
     curl -A "Mozilla/5.0" -L -s -d "field_input_title=$COLT&field_input_publications=$COLPUBLI&classname=Collection" http://$host/$instance/admin/create?classname=Collection
14
-    ITTHM="themetest"
15
-    ITNAME=$(lenmax=30;wcount=3; rlenmax=$(expr $lenmax - 1); echo $(shuf /usr/share/dict/words | head -n $wcount | tr -s "\n" " ") | sed -E "s/^(.{$rlenmax}).*$/\1/")
16
-    ITVAL=$(lenmax=10;wcount=1; rlenmax=$(expr $lenmax - 1); echo $(shuf /usr/share/dict/words | head -n $wcount | tr -s "\n" " ") | sed -E "s/^(.{$rlenmax}).*$/\1/")
17
-    curl -A "Mozilla/5.0" -L -s -d "field_input_theme=$ITTHM&field_input_name=$ITNAME&field_input_value=$ITVAL&classname=Indextheme" http://$host/$instance/admin/create?classname=Indextheme
18 14
     LN=$(lenmax=20;wcount=1; rlenmax=$(expr $lenmax - 1); echo $(shuf /usr/share/dict/words | head -n $wcount | tr -s "\n" " ") | sed -E "s/^(.{$rlenmax}).*$/\1/")
19 15
     FN=$(lenmax=20;wcount=1; rlenmax=$(expr $lenmax - 1); echo $(shuf /usr/share/dict/words | head -n $wcount | tr -s "\n" " ") | sed -E "s/^(.{$rlenmax}).*$/\1/")
20 16
     curl -A "Mozilla/5.0" -L -s -d "field_input_lastname=$LN&field_input_firstname=$FN&classname=Person" http://$host/$instance/admin/create?classname=Person
@@ -39,20 +35,8 @@ do
39 35
     done
40 36
     SECLP=$tmp
41 37
     SECST=$(lenmax=60;wcount=10; rlenmax=$(expr $lenmax - 1); echo $(shuf /usr/share/dict/words | head -n $wcount | tr -s "\n" " ") | sed -E "s/^(.{$rlenmax}).*$/\1/")
42
-    res=$(printf "use lodel2_$instance\n db.Indextheme.find({}, {lodel_id:1, _id:0}).limit(5)" | mongo  $HOSTDB/admin -u lodel2_admin -p lapwd  | sed "1,3d" | sed -e "s/{ \"lodel_id\" : //g" | sed -e "s/ }//g" | sed "\$d")
43
-    tmp=""
44
-    for i in $res
45
-    do
46
-        if [[ ! -z $tmp ]]
47
-        then
48
-            tmp=$(printf "$tmp, $i")
49
-        else
50
-            tmp=$i
51
-        fi
52
-    done
53
-    SECIND=$tmp
54 38
     SECTTL=$(lenmax=60;wcount=5; rlenmax=$(expr $lenmax - 1); echo $(shuf /usr/share/dict/words | head -n $wcount | tr -s "\n" " ") | sed -E "s/^(.{$rlenmax}).*$/\1/")
55
-    curl -A "Mozilla/5.0" -L -s -d "field_input_linked_persons=$SECLP&field_input_subtitle=$SECST&field_input_indexes=$SECIND&field_input_title=$SECTTL&classname=Section" http://$host/$instance/admin/create?classname=Section
39
+    curl -A "Mozilla/5.0" -L -s -d "field_input_linked_persons=$SECLP&field_input_subtitle=$SECSTD&field_input_title=$SECTTL&classname=Section" http://$host/$instance/admin/create?classname=Section
56 40
 done
57 41
 
58 42
 for i in `eval echo {1..$N}`;
@@ -71,20 +55,9 @@ do
71 55
     SSSECST=$(lenmax=60;wcount=10; rlenmax=$(expr $lenmax - 1); echo $(shuf /usr/share/dict/words | head -n $wcount | tr -s "\n" " ") | sed -E "s/^(.{$rlenmax}).*$/\1/")
72 56
     res=$(printf "use lodel2_$instance\n db.Section.find({}, {lodel_id:1, _id:0}).limit(1)" | mongo  $HOSTDB/admin -u lodel2_admin -p lapwd  | sed "1,3d" | sed -e "s/{ \"lodel_id\" : //g" | sed -e "s/ }//g" | sed "\$d")
73 57
     SSSECPAR=$res
74
-    res=$(printf "use lodel2_$instance\n db.Indextheme.find({}, {lodel_id:1, _id:0}).limit(3)" | mongo  $HOSTDB/admin -u lodel2_admin -p lapwd  | sed "1,3d" | sed -e "s/{ \"lodel_id\" : //g" | sed -e "s/ }//g" | sed "\$d")
75
-    tmp=""
76
-    for i in $res
77
-    do
78
-        if [[ ! -z $tmp ]]
79
-        then
80
-            tmp=$(printf "$tmp, $i")
81
-        else
82
-            tmp=$i
83
-        fi    
84
-    SSSECIND=$tmp
85 58
     SSSECTTL=$(lenmax=60;wcount=5; rlenmax=$(expr $lenmax - 1); echo $(shuf /usr/share/dict/words | head -n $wcount | tr -s "\n" " ") | sed -E "s/^(.{$rlenmax}).*$/\1/")
86
-    res=$(printf "use lodel2_$instance\n db.Collection.find({}, {lodel_id:1, _id:0}).limit\(1\)" | mongo  $HOSTDB/admin -u lodel2_admin -p lapwd  | sed "1,3d" | sed -e "s/{ \"lodel_id\" : //g" | sed -e "s/ }//g" | sed "\$d")
59
+    res=$(printf "use lodel2_$instance\n db.Collection.find({}, {lodel_id:1, _id:0}).limit(1)" | mongo  $HOSTDB/admin -u lodel2_admin -p lapwd  | sed "1,3d" | sed -e "s/{ \"lodel_id\" : //g" | sed -e "s/ }//g" | sed "\$d")
87 60
     PUBCOLLS=$res
88
-    curl -A "Mozilla/5.0" -L -s -d "field_input_linked_persons=$SSSECLP&field_input_subtitle=$SSSECST&field_input_parent=$SSSECPAR&field_input_indexes=$SSSECIND&field_input_title=$SSSECTTL&classname=Subsection" http://$host/$instance/admin/create?classname=Subsection
61
+    curl -A "Mozilla/5.0" -L -s -d "field_input_linked_persons=$SSSECLP&field_input_subtitle=$SSSECST&field_input_parent=$SSSECPAR&field_input_title=$SSSECTTL&classname=Subsection" http://$host/$instance/admin/create?classname=Subsection
89 62
     curl -A "Mozilla/5.0" -L -s -d "field_input_collection=$PUBCOLLS&classname=Publication" http://$host/$instance/admin/create?classname=Publication
90
-done
63
+done

Loading…
Cancel
Save