Last active
July 18, 2020 16:37
-
-
Save rubo77/c7a9434eb104c00bf8772b2278284360 to your computer and use it in GitHub Desktop.
automatically create an index.html file in the current folder, that contains the whole path
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# scriptname: /usr/local/sbin/directory-long-index.sh | |
# | |
# the directory_root without slash at the end: | |
WEB=/var/www/ | |
#reacheable url from inside the server: | |
URL=http://localhost | |
P=$(pwd|sed "s|$WEB/||") | |
echo "download $URL/$P/ to index.html" | |
curl "$URL/$P/" -o index.html | |
sed -i 's|href="\(.*\)".*</a>|style="display:inline-block;min-width:500px" href="\1">\1</a>|' index.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment