In the /htmlroot/cgi.html, I added this 3 lines:
Then, in the /htmlroot/cgi/ I wrote the 'backupchannelfile.cgi'
Code:
#!/bin/hush
echo Content-type: text/html
echo
echo Backup ChannelList.ch ...
echo
cd /systempart
cp ChannelList.ch /hdd/stage2/htmlroot/backup/ChannelList.ch
cp ChannelList.ch /hdd/stage2/htmlroot/restore/ChannelList.ch
cd /hdd/stage2/htmlroot/backup
gzip -5 ChannelList.ch
mv ChannelList.ch.gz ChannelList.ch.zip
echo
echo Finished - send me back
echo
cat /hdd/stage2/htmlroot/cgi/goback.txt
the /htmlroot/cgi/goback.txt
Code:
<HTML>
<header>
<meta http-equiv="Refresh" Content="1; URL=/index.html">
</header><body>
</BODY>
</HTML>
and finally the /htmlroot/cgi/ restorechannelfile.cgi
Code:
#!/bin/hush
echo Content-type: text/html
echo
echo Restoring ChannelList.ch ...
echo
cd /hdd/stage2/htmlroot/restore
cp ChannelList.ch /systempart/ChannelList.ch
echo
echo Finished - send me back
echo
cat /hdd/stage2/htmlroot/cgi/goback.txt
I am not a pro-CGI-Coder!! I wrote it just for fun and to learn how it works. If you see some errors or improvements, please let me know!
Maybe, it would be easier for all the people to download all the files in single *.zip-archive and the necessary instructions where to copy:
/cgi/backupchannelfile.cgi
/cgi/restorechannelfile.cgi
/cgi/goback.txt
Don't forget to chmod the *.cgi-files to 777. You can use a FTP-Client or have to open a telnet-window to your KiSS with:
telnet ip-adress (e.g. telnet 192.168.1.55)
change to the cgi-directory with:
cd /hdd/stage2/htmlroot/cgi
and apply the chmod-command like this:
chmod 777 backupchannel.cgi
chmod 777 restorechannel.cgi
Again, tell me what you think and of course if it works for you!