aboutsummaryrefslogtreecommitdiff
path: root/doc/problemexamples/gen_examples.sh
blob: 6f11671226c2e0556e867409a6397a30ca259b3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash
if [ "$1" == "" ]; then
  echo "CREATING FILES WITHOUT PASSWORDS"
  for i in `ls`; do 
    if [ -d $i ]; then 
      cd $i; zip -r ../$i.zip .; cd -; 
    fi
  done
else
  echo "USING ARGUMENT AS PASSWORD"
  rm -f keys.txt
  for i in `ls`; do 
    if [ -d $i ]; then 
      ../../src/private/createproblemzip.php "$i" "$i.zip" "$1" | grep -A2 "The following line" | tail -n1 >> keys.txt
    fi
  done
fi