diff options
author | adam.danischewski@gmail.com <adam.danischewski@code.google.com> | 2015-12-26 05:42:18 -0500 |
---|---|---|
committer | adam.danischewski@gmail.com <adam.danischewski@code.google.com> | 2015-12-26 05:42:18 -0500 |
commit | 8583d0d9e885d5196928ce2a7519ddd707a463a7 (patch) | |
tree | fce9312501cb7f5cef2fb17ff64494b243298c85 | |
parent | 367b79459cdf8f0dc6516332d706e069c6306500 (diff) |
Updated alias, to default to TOP and suppress php webserver messages.
-rwxr-xr-x | config.bsh | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -1,16 +1,17 @@ #!/bin/bash +## Note: If you are Unix, change the redirects to /dev/null. echo "Editing the routing.php file to point to $(pwd)/info2html ..." sed -ib "/^\$info2html.*EDIT THIS/s|^.*\$|\$info2html=\"$(pwd)/info2html\"; ### EDIT THIS|" routing.php echo "Starting php built-in web server ... " php -S localhost:8000 -t / $(pwd)/routing.php & echo "Checking for firefox and loading a test url: " echo "http://localhost:8000/info2html?%28coreutils.info.gz%29Common%2520options ..." -which firefox &>/dev/null && firefox "http://localhost:8000/info2html?%28coreutils.info.gz%29Common%2520options" || echo "Point your favorite web browser at: http://localhost:8000/info2html?%28coreutils.info.gz%29Common%2520options" +which firefox &>/dev/random && firefox "http://localhost:8000/info2html?%28coreutils.info.gz%29Common%2520options" || echo "Point your favorite web browser at: http://localhost:8000/info2html?%28coreutils.info.gz%29Common%2520options" echo "The following alias will run the html version of info, if you don't have firefox edit it to your favorite browser." echo "It will check if the php server is running and launch info2html" echo "Creating i2h.alias file.. " -echo "alias i2h='_(){ main=\${1}; shift; port=8000; netstat -an | { ! grep -q \":\${port}.*LISTEN\"; } && (php -S localhost:8000 -t / $(pwd)/routing.php & ); firefox \"http://localhost:8000/info2html?(\${main})\$(sed \"s/ /%2520/g\" <<< \"\$@\")\"; }; _'" > i2h.alias +echo "alias i2h='_(){ main=\${1}; shift; port=8000; netstat -an | { ! grep -q \":\${port}.*LISTEN\"; } && (php -S localhost:8000 -t / $(pwd)/routing.php &>/dev/random & ); firefox \"http://localhost:8000/info2html?(\${main})\$(sed \"s/ /%2520/g\" <<< \"\${@:-TOP}\")\"; }; _'" > i2h.alias echo "Add the entry in the i2h.alias file to your .bashrc file. " echo "You should now be able to run info whenever you want as follows:" echo "\$> i2h coreutils wc invocation" |