Compare commits
No commits in common. "c5d2e441567334171c11d5825bdbd619d6ad1952" and "a037dd3fece127a182cc623d69eb880b1611def9" have entirely different histories.
c5d2e44156
...
a037dd3fec
45
clean.sh
45
clean.sh
@ -1,45 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Variables
|
|
||||||
find_list="/tmp/find_list"
|
|
||||||
files_list="/tmp/files_list"
|
|
||||||
path_gen=$(pwd)
|
|
||||||
make_file=${path_gen}/index.sh
|
|
||||||
|
|
||||||
# Show help and clean index files recursively
|
|
||||||
if [ -z "${1}" ] ; then
|
|
||||||
echo ""
|
|
||||||
echo "Usage: $0 <folder>"
|
|
||||||
echo ""
|
|
||||||
else
|
|
||||||
# Generate list recursive
|
|
||||||
if [ -d "${1}" ] ; then
|
|
||||||
list_find=$(find "${1}"/ -type d \( ! -iname ".*" \))
|
|
||||||
echo > ${find_list}
|
|
||||||
for list in $list_find ; do
|
|
||||||
check_list=$(echo $list | grep "/res")
|
|
||||||
if [ -z ${check_list} ] ; then
|
|
||||||
echo ${list} >> ${find_list}
|
|
||||||
else
|
|
||||||
echo > /dev/null
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
count_find=$(wc -l ${find_list} | cut -d " " -f 1)
|
|
||||||
countf=1
|
|
||||||
while [ ${countf} -le ${count_find} ] ; do
|
|
||||||
find_read=$(cat ${find_list} | head -${countf} | tail -1)
|
|
||||||
rm -rf ${find_read}/.res 2> /dev/null
|
|
||||||
rm -rf ${find_read}/.index.html 2> /dev/null
|
|
||||||
rm -rf ${find_read}/.index.sh 2> /dev/null
|
|
||||||
if [ ! -z "${find_read}" ] ; then
|
|
||||||
echo "# Cleaning index files for ${find_read}"
|
|
||||||
fi
|
|
||||||
cd ${find_read}
|
|
||||||
cd ${path_gen}
|
|
||||||
countf=$(expr ${countf} + 1)
|
|
||||||
done
|
|
||||||
#rm -rf ${find_list}
|
|
||||||
else
|
|
||||||
echo "# Folder '${1}' not found"
|
|
||||||
fi
|
|
||||||
fi
|
|
@ -1,54 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Variables
|
|
||||||
find_list="/tmp/find_list"
|
|
||||||
files_list="/tmp/files_list"
|
|
||||||
path_gen=$(pwd)
|
|
||||||
make_file=${path_gen}/index.sh
|
|
||||||
|
|
||||||
# Show help and init generate index files recursively
|
|
||||||
if [ -z "${1}" ] ; then
|
|
||||||
echo ""
|
|
||||||
echo "Usage: $0 <folder>"
|
|
||||||
echo ""
|
|
||||||
else
|
|
||||||
cp -rf ${path_gen}/index.sh ${path_gen}/.index.sh 2> /dev/null
|
|
||||||
chmod +x ${make_file}
|
|
||||||
bash ${path_gen}/index.sh "${1}"
|
|
||||||
# Generate index recursive
|
|
||||||
if [ -d "${1}" ] ; then
|
|
||||||
list_find=$(find "${1}"/ -type d \( ! -iname ".*" \))
|
|
||||||
echo > ${find_list}
|
|
||||||
for list in $list_find ; do
|
|
||||||
check_list=$(echo $list | grep "/res")
|
|
||||||
if [ -z ${check_list} ] ; then
|
|
||||||
echo ${list} >> ${find_list}
|
|
||||||
else
|
|
||||||
echo > /dev/null
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
count_find=$(wc -l ${find_list} | cut -d " " -f 1)
|
|
||||||
countf=1
|
|
||||||
while [ ${countf} -le ${count_find} ] ; do
|
|
||||||
find_read=$(cat ${find_list} | head -${countf} | tail -1)
|
|
||||||
rm -rf ${find_read}/.res/res 2> /dev/null
|
|
||||||
cp -rf ${path_gen}/.res ${find_read}/ 2> /dev/null
|
|
||||||
cp -rf ${path_gen}/res ${find_read}/.res 2> /dev/null
|
|
||||||
cp -rf ${path_gen}/index.sh ${find_read}/.index.sh 2> /dev/null
|
|
||||||
cp -rf ${path_gen}/.index.sh ${find_read}/.index.sh 2> /dev/null
|
|
||||||
#cp -rf ${path_gen}/index-recursive.sh ${find_read}/.index-recursive.sh 2> /dev/null
|
|
||||||
#cp -rf ${path_gen}/.index-recursive.sh ${find_read}/.index-recursive.sh 2> /dev/null
|
|
||||||
if [ ! -z "${find_read}" ] ; then
|
|
||||||
echo "# Generating index files for ${find_read}"
|
|
||||||
fi
|
|
||||||
cd ${find_read}
|
|
||||||
chmod +x .index.sh 2> /dev/null
|
|
||||||
bash .index.sh . 2> /dev/null
|
|
||||||
cd ${path_gen}
|
|
||||||
countf=$(expr ${countf} + 1)
|
|
||||||
done
|
|
||||||
#rm -rf ${find_list}
|
|
||||||
else
|
|
||||||
echo "# Folder '${1}' not found"
|
|
||||||
fi
|
|
||||||
fi
|
|
@ -1,3 +0,0 @@
|
|||||||
<html>
|
|
||||||
<meta http-equiv="Refresh" content="0; url='files/.index.html'" />
|
|
||||||
</html>
|
|
72
index.sh
72
index.sh
@ -1,72 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Variables
|
|
||||||
find_list="/tmp/find_list"
|
|
||||||
files_list="/tmp/files_list"
|
|
||||||
path_gen=$(pwd)
|
|
||||||
|
|
||||||
# Commands
|
|
||||||
ls_command="/bin/ls"
|
|
||||||
|
|
||||||
# Show help and init generate index files
|
|
||||||
if [ -z "${1}" ] ; then
|
|
||||||
echo ""
|
|
||||||
echo "Usage: $0 <folder>"
|
|
||||||
echo ""
|
|
||||||
else
|
|
||||||
# Generate main index folder
|
|
||||||
if [ -d "${1}" ] ; then
|
|
||||||
#echo "# Generating index files for ${1}"
|
|
||||||
${ls_command} -1 --group-directories-first "${1}"/ > ${files_list}
|
|
||||||
rm -rf ${1}/.res/res 2> /dev/null
|
|
||||||
cp -rf ${path_gen}/res ${1}/.res 2> /dev/null
|
|
||||||
cp -rf ${path_gen}/res/head.html ${1}/.index.html 2> /dev/null
|
|
||||||
cp -rf ${path_gen}/.res ${1}/ 2> /dev/null
|
|
||||||
cp -rf ${path_gen}/.res/head.html ${1}/.index.html 2> /dev/null
|
|
||||||
count_list=$(wc -l ${files_list} | cut -d " " -f 1)
|
|
||||||
count=1
|
|
||||||
while [ ${count} -le ${count_list} ] ; do
|
|
||||||
line_read=$(cat ${files_list} | head -${count} | tail -1)
|
|
||||||
if [ "${line_read}" == "index.sh" ] ; then
|
|
||||||
count=$(expr ${count} + 1)
|
|
||||||
elif [ "${line_read}" == "index-recursive.sh" ] ; then
|
|
||||||
count=$(expr ${count} + 1)
|
|
||||||
elif [ "${line_read}" == "index.html" ] ; then
|
|
||||||
count=$(expr ${count} + 1)
|
|
||||||
elif [ "${line_read}" == "res" ] ; then
|
|
||||||
count=$(expr ${count} + 1)
|
|
||||||
else
|
|
||||||
if [ -d "${line_read}" ] ; then
|
|
||||||
echo "# Generating entry for '${line_read}'"
|
|
||||||
echo -n '<li class="list-group-item"><center><img src=".res/folder.png" width="21" height="21"> <a href="' >> ${1}/.index.html
|
|
||||||
echo -n "${line_read}/.index.html" >> ${1}/.index.html
|
|
||||||
echo -n '">' >> ${1}/.index.html
|
|
||||||
echo -n "${line_read}" >> ${1}/.index.html
|
|
||||||
echo '</a></center></li>' >> ${1}/.index.html
|
|
||||||
count=$(expr ${count} + 1)
|
|
||||||
elif [ -f "${line_read}" ] ; then
|
|
||||||
echo "# Generating entry for '${line_read}'"
|
|
||||||
echo -n '<li class="list-group-item"><center><img src=".res/file.png" width="21" height="21"> <a href="' >> ${1}/.index.html
|
|
||||||
echo -n "${line_read}" >> ${1}/.index.html
|
|
||||||
echo -n '">' >> ${1}/.index.html
|
|
||||||
echo -n "${line_read}" >> ${1}/.index.html
|
|
||||||
echo '</a></center></li>' >> ${1}/.index.html
|
|
||||||
count=$(expr ${count} + 1)
|
|
||||||
else
|
|
||||||
echo "# Generating entry for '${line_read}'"
|
|
||||||
echo -n '<li class="list-group-item"><center><img src=".res/link.png" width="23" height="21"> <a href="' >> ${1}/.index.html
|
|
||||||
echo -n "${line_read}/.index.html" >> ${1}/.index.html
|
|
||||||
echo -n '">' >> ${1}/.index.html
|
|
||||||
echo -n "${line_read}" >> ${1}/.index.html
|
|
||||||
echo '</a></center></li>' >> ${1}/.index.html
|
|
||||||
count=$(expr ${count} + 1)
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
cat ${path_gen}/res/tail.html >> ${1}/.index.html 2> /dev/null
|
|
||||||
cat ${path_gen}/.res/tail.html >> ${1}/.index.html 2> /dev/null
|
|
||||||
rm -rf ${files_list}
|
|
||||||
else
|
|
||||||
echo "# Folder '${1}' not found"
|
|
||||||
fi
|
|
||||||
fi
|
|
14
lang/de.html
14
lang/de.html
@ -1,14 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="s" dir="ltr">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<link rel="shortcut icon" href=".res/folder.png">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
||||||
<title>Files - Über das HTTP(s)-Protokoll freigegebene Dateien</title>
|
|
||||||
<link rel="stylesheet" href=".res/bootstrap-dark.min.css">
|
|
||||||
</head>
|
|
||||||
<body class="bootstrap-dark">
|
|
||||||
<div class="container">
|
|
||||||
<h4><center><img src=".res/folder.png" width="25" height="25"> Files - Über das HTTP(s)-Protokoll freigegebene Dateien</center></h4>
|
|
||||||
<ul class="list-group">
|
|
||||||
<li class="list-group-item"><center><a href="../.index.html">Zurück <img src=".res/arrow.png" width="10" height="15"> Zum vorherigen Verzeichnis wechseln</a></center></li>
|
|
14
lang/en.html
14
lang/en.html
@ -1,14 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="s" dir="ltr">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<link rel="shortcut icon" href=".res/folder.png">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
||||||
<title>Files - Files shared via HTTP(s) protocol</title>
|
|
||||||
<link rel="stylesheet" href=".res/bootstrap-dark.min.css">
|
|
||||||
</head>
|
|
||||||
<body class="bootstrap-dark">
|
|
||||||
<div class="container">
|
|
||||||
<h4><center><img src=".res/folder.png" width="25" height="25"> Files - Files shared via HTTP(s) protocol</center></h4>
|
|
||||||
<ul class="list-group">
|
|
||||||
<li class="list-group-item"><center><a href="../.index.html">Back <img src=".res/arrow.png" width="10" height="15"> Go to previous directory</a></center></li>
|
|
14
lang/es.html
14
lang/es.html
@ -1,14 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="s" dir="ltr">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<link rel="shortcut icon" href=".res/folder.png">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
||||||
<title>Files - Archivos compartidos mediante el protocolo HTTP(s)</title>
|
|
||||||
<link rel="stylesheet" href=".res/bootstrap-dark.min.css">
|
|
||||||
</head>
|
|
||||||
<body class="bootstrap-dark">
|
|
||||||
<div class="container">
|
|
||||||
<h4><center><img src=".res/folder.png" width="25" height="25"> Files - Archivos compartidos mediante el protocolo HTTP(s)</center></h4>
|
|
||||||
<ul class="list-group">
|
|
||||||
<li class="list-group-item"><center><a href="../.index.html">Atrás <img src=".res/arrow.png" width="10" height="15"> Ir al directorio previo</a></center></li>
|
|
14
lang/fr.html
14
lang/fr.html
@ -1,14 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="s" dir="ltr">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<link rel="shortcut icon" href=".res/folder.png">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
||||||
<title>Files - Fichiers partagés via le protocole HTTP(s)</title>
|
|
||||||
<link rel="stylesheet" href=".res/bootstrap-dark.min.css">
|
|
||||||
</head>
|
|
||||||
<body class="bootstrap-dark">
|
|
||||||
<div class="container">
|
|
||||||
<h4><center><img src=".res/folder.png" width="25" height="25"> Files - Fichiers partagés via le protocole HTTP(s)</center></h4>
|
|
||||||
<ul class="list-group">
|
|
||||||
<li class="list-group-item"><center><a href="../.index.html">Retour <img src=".res/arrow.png" width="10" height="15"> Aller au répertoire précédent</a></center></li>
|
|
14
lang/it.html
14
lang/it.html
@ -1,14 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="s" dir="ltr">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<link rel="shortcut icon" href=".res/folder.png">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
||||||
<title>Files - File condivisi tramite protocollo HTTP(s)</title>
|
|
||||||
<link rel="stylesheet" href=".res/bootstrap-dark.min.css">
|
|
||||||
</head>
|
|
||||||
<body class="bootstrap-dark">
|
|
||||||
<div class="container">
|
|
||||||
<h4><center><img src=".res/folder.png" width="25" height="25"> Files - File condivisi tramite protocollo HTTP(s)</center></h4>
|
|
||||||
<ul class="list-group">
|
|
||||||
<li class="list-group-item"><center><a href="../.index.html">Indietro <img src=".res/arrow.png" width="10" height="15"> Vai alla directory precedente</a></center></li>
|
|
14
lang/ru.html
14
lang/ru.html
@ -1,14 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="s" dir="ltr">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<link rel="shortcut icon" href=".res/folder.png">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
||||||
<title>Files - Обмен файлами по протоколу HTTP(s)</title>
|
|
||||||
<link rel="stylesheet" href=".res/bootstrap-dark.min.css">
|
|
||||||
</head>
|
|
||||||
<body class="bootstrap-dark">
|
|
||||||
<div class="container">
|
|
||||||
<h4><center><img src=".res/folder.png" width="25" height="25"> Files - Обмен файлами по протоколу HTTP(s)</center></h4>
|
|
||||||
<ul class="list-group">
|
|
||||||
<li class="list-group-item"><center><a href="../.index.html">Назад <img src=".res/arrow.png" width="10" height="15"> Перейти в предыдущий каталог</a></center></li>
|
|
@ -1,9 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
dir=$(dirname $0)
|
|
||||||
dir_files="$(dirname $0)/files"
|
|
||||||
|
|
||||||
# Create index for HTML
|
|
||||||
cd ${dir}
|
|
||||||
bash clean.sh ${dir_files}
|
|
||||||
bash index-recursive.sh ${dir_files}
|
|
BIN
res/arrow.png
BIN
res/arrow.png
Binary file not shown.
Before Width: | Height: | Size: 331 B |
7968
res/bootstrap-dark.min.css
vendored
7968
res/bootstrap-dark.min.css
vendored
File diff suppressed because it is too large
Load Diff
BIN
res/file.png
BIN
res/file.png
Binary file not shown.
Before Width: | Height: | Size: 5.0 KiB |
BIN
res/folder.png
BIN
res/folder.png
Binary file not shown.
Before Width: | Height: | Size: 6.3 KiB |
@ -1,14 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="s" dir="ltr">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<link rel="shortcut icon" href=".res/folder.png">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
||||||
<title>Files - Files shared via HTTP(s) protocol</title>
|
|
||||||
<link rel="stylesheet" href=".res/bootstrap-dark.min.css">
|
|
||||||
</head>
|
|
||||||
<body class="bootstrap-dark">
|
|
||||||
<div class="container">
|
|
||||||
<h4><center><img src=".res/folder.png" width="25" height="25"> Files - Files shared via HTTP(s) protocol</center></h4>
|
|
||||||
<ul class="list-group">
|
|
||||||
<li class="list-group-item"><center><a href="../.index.html">Back <img src=".res/arrow.png" width="10" height="15"> Go to previous directory</a></center></li>
|
|
BIN
res/link.png
BIN
res/link.png
Binary file not shown.
Before Width: | Height: | Size: 1.5 KiB |
@ -1,5 +0,0 @@
|
|||||||
</ul>
|
|
||||||
<br>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
BIN
res/ubuntu.ttf
BIN
res/ubuntu.ttf
Binary file not shown.
29
set-lang.sh
29
set-lang.sh
@ -1,29 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
dir=$(dirname $0)
|
|
||||||
lang_dir="$(dirname $0)/lang"
|
|
||||||
|
|
||||||
# List available languages
|
|
||||||
lang_available=$(ls -1 ${lang_dir}/ 2> /dev/null | cut -d "." -f 1)
|
|
||||||
|
|
||||||
# Set language
|
|
||||||
if [ -z "${1}" ] ; then
|
|
||||||
echo ""
|
|
||||||
echo "* Set language for html indexer"
|
|
||||||
echo ""
|
|
||||||
echo "Sintax: $0 <lang>"
|
|
||||||
echo ""
|
|
||||||
echo "Available lang:" ${lang_available}
|
|
||||||
echo ""
|
|
||||||
else
|
|
||||||
if [ -f "${lang_dir}/${1}.html" ] ; then
|
|
||||||
cp -rf "${lang_dir}/${1}.html" "${dir}/res/head.html"
|
|
||||||
echo "Language '${1}' set correctly"
|
|
||||||
echo "Run 'make-html-browser.sh' for to generate the html files"
|
|
||||||
exit 0
|
|
||||||
else
|
|
||||||
echo "Language '${1}' not available"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user