~npisanti/npisantidotcomssg

ref: e9337371f62c1b63086e93fdaa41e75273e2abdb npisantidotcomssg/upload_html.sh -rwxr-xr-x 1.1 KiB
e9337371Nicola Pisanti finished porting to fish 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
#!/usr/bin/fish

echo 'the ftp transfer used in this script is not encrypted, are you behind a trusted connection?'
	
while true
    set yn (read -P [y/n]: ) 

	switch "$yn"
    case Y y yes
    	break
    case N n no
    	 echo "goodbye!" 
    	 exit
    case '*'
    	echo "Please answer yes or no."
    end
end

set ftpuser (read -P user: )
set ftppass (read -s -P password: )

echo ""

set FOLDERS "main" "ink" "installations" "music" "visuals" "posts" "pages"

for f in $FOLDERS
	echo "uploading folder $f"
	ncftpput -R -v -u "$ftpuser" -p "$ftppass" ftp.npisanti.com public_html "~/htdocs/npisantidotcomssg/html_output/$f/"
end

echo "uploading index and CSS..."
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/style.css

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