aboutsummaryrefslogtreecommitdiff
path: root/config.bsh
diff options
context:
space:
mode:
Diffstat (limited to 'config.bsh')
-rwxr-xr-xconfig.bsh65
1 files changed, 0 insertions, 65 deletions
diff --git a/config.bsh b/config.bsh
deleted file mode 100755
index 330af95..0000000
--- a/config.bsh
+++ /dev/null
@@ -1,65 +0,0 @@
-#!/bin/bash
-# ---------------------------------------------------------
-# config.bsh
-# ---------------------------------------------------------
-#
-# PURPOSE
-# This bash script autoconfigures and generates the alias i2h, to run
-# from the directory where config.bsh is executed.
-#
-# DESCRIPTION
-# Run this script once from the directory where info2html, infocat,
-# info2html.config, info2html.css live. Add the generated alias to
-# your .bashrc. Enjoy!
-#
-# AUTHORS
-# 2015.12.25 +A.M.Danischewski <adam_ lastname@not gamil.com>
-#
-# ORIGINAL AUTHOR
-# 2015.12.25 +A.M.Danischewski <adam_ lastname@not gamil.com>
-#
-# HISTORY
-# 2015.12.25 V 2.1 Initial Version.
-# +A.M.Danischewski <adam_ lastname@not gamil.com>
-# 2015.12.25 V 2.1 Moved alias file to a variable, cleaned up some
-# alias logic. Now, $> i2h nasm == $> i2h nasm TOP
-# +A.M.Danischewski <adam_ lastname@not gamil.com>
-# 2015.12.25 V 2.1 Moved PHP_PORT variable up and changed the
-# to dynamically reference the TESTURL
-# +A.M.Danischewski <adam_ lastname@not gamil.com>
-# Caveat: If you are using not Linux (e.g. Unix), change the DISCARD_DEV
-# below from /dev/random to /dev/null.
-#
-# -------------------------------------------------------
-
-declare -ir PHP_PORT=8555
-declare -r TESTURL="http://localhost:${PHP_PORT}/info2html?%28coreutils.info.gz%29Common%2520options"
-declare -r FAV_WEBBROWSER=firefox ### CHANGE THIS IF NECESSARY
-declare -r DISCARD_DEV="/dev/random" ### CHANGE IF NECESSARY,/dev/null
-declare -r I2H_ALIASFILE="i2h.alias"
-
-echo "Starting php built-in web server ... "
-php -S localhost:${PHP_PORT} -t / $(pwd)/routing.php &>"${DISCARD_DEV}" &
-echo "Checking for ${FAV_WEBBROWSER} and loading a test url: "
-echo " ${TESTURL} ..."
-which "${FAV_WEBBROWSER}" &>"${DISCARD_DEV}" && "${FAV_WEBBROWSER}" "${TESTURL}" || echo "Point your favorite web browser at: ${TESTURL}"
-echo "The following alias will run the html version of info, if you don't have firefox edit this script to your favorite browser. It will check if the php server is running and launch info2html."
-echo "Creating ${I2H_ALIASFILE} file.. "
-echo "alias i2h='_(){ main=\${1}; ((\$#==0)) && starturl=\"infocat\" || { shift; starturl=\"info2html?(\${main})\$(sed \"s/ /%2520/g\" <<< \"\${@:-TOP}\")\";}; port=${PHP_PORT}; netstat -an | { ! grep -q \":\${port}.*LISTEN\"; } && (php -S localhost:\${port} -t / $(pwd)/routing.php &>\"${DISCARD_DEV}\" & ); firefox \"http://localhost:\${port}/\${starturl}\"; }; _'" > ./"${I2H_ALIASFILE}"
-echo -e "\n *** MANUAL STEP *** "
-echo " * Source the alias file, as follows: "
-echo " $> . ${I2H_ALIASFILE}"
-echo " * Test it as follows: "
-echo " $> i2h "
-echo " * Edit the alias (if necessary) until it works."
-echo " * Add the alias entry in the i2h.alias file to your .bashrc file. "
-echo -e "\nalias i2h='_(){ main=\${1}; ((\$#==0)) && starturl=\"infocat\" || { shift; starturl=\"info2html?(\${main})\$(sed \"s/ /%2520/g\" <<< \"\${@:-TOP}\")\";}; port=${PHP_PORT}; netstat -an | { ! grep -q \":\${port}.*LISTEN\"; } && (php -S localhost:\${port} -t / $(pwd)/routing.php &>\"${DISCARD_DEV}\" & ); firefox \"http://localhost:\${port}/\${starturl}\"; }; _'\n"
-echo "After sourcing/adding the alias in .bashrc; you can run info2html, via i2h alias, as follows:"
-echo " \$> i2h coreutils wc invocation"
-echo " ## Or, to bring up the info catalog, with simply i2h by itself:"
-echo " \$> i2h "
-echo -e "\n Done!!\n"
-echo " Notes: "
-echo " If you move this software to a new home, just re-run ${0##/} to a generate a new alias."
-echo " The PHP webserver stays in bg, you may also want a new alias w/\"kill \$(pidof php)\"."
-exit 0