start working on ftp and webdav scripts

This commit is contained in:
Pi
2019-02-26 09:38:33 -05:00
parent c273d2e369
commit 9dd17b23ad
5 changed files with 55 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
#! /bin/bash
HOST='192.168.90.2'
USER='jody'
PASSWD='jodyw4sh3re'
ftp -n -v $HOST << EOT
bin
user $USER $PASSWD
prompt
lcd /home/pi/ftp
get file.zip
bye
EOT

17
roles/ftpclient/tasks/main.yaml Executable file
View File

@@ -0,0 +1,17 @@
---
- name: enable cron job for ftp traffic
cron:
name: "ftptraff"
minute: "*/30"
hour: "7-18"
weekday: "1-5"
job: "/usr/bin/perl -e 'sleep int rand 1799' && /home/pi/scripts/smb-session.sh"
tags: ftptraff_cron
- name: copy ftp-session.sh to scripts directory
copy:
src: "{{ role_path }}/files/ftp-session.sh"
dest: /home/pi/scripts/ftp-session.sh
owner: pi
group: pi
mode: a+x
tags: ftptraff_script

View File

@@ -0,0 +1,4 @@
#! /bin/bash
ls /home/pi/zip > /home/pi/zip/files.txt
rm /home/pi/zip/*ZIP
rm /home/pi/zip/*zip

View File

@@ -0,0 +1,18 @@
#! /usr/bin/expect
spawn /usr/bin/cadaver http://192.168.60.2/webdav
expect "Username:"
send "jack\n"
expect "Password:"
send "jackw4sh3re\n"
expect "dav:/webdav/>"
send "lcd /home/pi/zip\n"
expect "dav:/webdav/>"
send "ls\n"
send "cd Training\n"
expect "dav:/webdav/Training/>"
send "ls\n"
expect "dav:/webdav/Training/>"
send "mget *\n"
expect "dav:/webdav/Training/>"
send "exit\n"

View File

@@ -0,0 +1,3 @@
#! /bin/bash
/home/pi/scripts/cadaver-webdav.sh
/home/pi/scripts/cadaver-webdav-clean.sh