~npisanti/npisantidotcomssg

ref: 88cdde99b2328f6ba743af66967b9d063f55c83f npisantidotcomssg/upload_html.sh -rwxr-xr-x 1.9 KiB
88cdde99Nicola Pisanti finished fish script 2 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash

while true; do
    read -p "the ftp transfer used in this script is not encrypted, are you behind a trusted connection? [y/n] " yn
    case $yn in
        [Yy]* ) break;;
        [Nn]* ) echo "goodbye!"; exit;;
        * ) echo "Please answer yes or no.";;
    esac
done

read -p "Username: " ftpuser
read -s -p "Password: " ftppass

echo ""

for d in input/journal/*/ ; do
    dirname=$(echo $d | cut -d '/' -f3)
    echo "uploading folder $dirname"
    ncftpput -R -v -u "$ftpuser" -p "$ftppass" ftp.npisanti.com public_html "~/htdocs/npisantidotcomssg/html_output/$dirname/"
done

echo "uploading main"
ncftpput -R -v -u "$ftpuser" -p "$ftppass" ftp.npisanti.com public_html "~/htdocs/npisantidotcomssg/html_output/main/"

echo "uploading posts"
ncftpput -R -v -u "$ftpuser" -p "$ftppass" ftp.npisanti.com public_html "~/htdocs/npisantidotcomssg/html_output/posts/"

echo "uploading basic pages..."
ncftpput -u "$ftpuser" -p "$ftppass" ftp.npisanti.com public_html ~/htdocs/npisantidotcomssg/html_output/index.html

ncftpput -u "$ftpuser" -p "$ftppass" ftp.npisanti.com public_html ~/htdocs/npisantidotcomssg/html_output/more.html

ncftpput -u "$ftpuser" -p "$ftppass" ftp.npisanti.com public_html ~/htdocs/npisantidotcomssg/html_output/contact.html

ncftpput -u "$ftpuser" -p "$ftppass" ftp.npisanti.com public_html ~/htdocs/npisantidotcomssg/html_output/tcatnoc.html

ncftpput -u "$ftpuser" -p "$ftppass" ftp.npisanti.com public_html ~/htdocs/npisantidotcomssg/html_output/style.css

echo "uploading pages"
for f in input/pages/* ; do
    page=$(echo $f | cut -d '/' -f3)
    ncftpput -R -v -u "$ftpuser" -p "$ftppass" ftp.npisanti.com public_html "~/htdocs/npisantidotcomssg/html_output/$page"
done

echo "uploading RSS"
ncftpput -u "$ftpuser" -p "$ftppass" ftp.npisanti.com public_html ~/htdocs/npisantidotcomssg/html_output/rss.xml
ncftpput -u "$ftpuser" -p "$ftppass" ftp.npisanti.com public_html/journal ~/htdocs/npisantidotcomssg/html_output/journal/rss.xml

exit