Paper Lantern for cPanel accounts is being retired this year. Find out more »
cPanel & WHM Version 102 has been released, and brings a slew of great updates. Take a look at what is included, and then upgrade today!
This object is in archive! 

Restore /scripts/uf

brant shared this idea 9 years ago
Open Discussion

In cPanel 11.40, "/scripts/uf" has been removed. As a System Administrator and Technical Troubleshooter, I find "uf" very useful for determining VirtualHost data from the Apache configuration. The original "uf" features unnecessary use of cat (UUoC), and it's really just "grep -2 http://www.example.com /usr/local/apache/conf/httpd.conf". However, as a troubleshooter who logs into multiple cPanel servers, this script has been part of my toolkit for years. Its removal forces me to slow down and execute another command (namely, the "grep" usage above); in turn, the potential for data entry error is increased.


In particular, I have used "/scripts/uf" to determine these VirtualHost data:


01. ServerName


02. ServerAlias


03. IP address and port


04. cPanel username and home directory


05. DocumentRoot


06. Show only VirtualHost for the domain in question with "www." prepended (/scripts/uf http://www.example.com).


07. Show any SSL VirtualHost configured for the domain:


root@nerv [~]# /scripts/uf http://www.example.com<VirtualHost 192.168.48.156:80> ServerName example.com ServerAlias http://www.example.com DocumentRoot /home/example/public_html ServerAdmin webmaster@example.com--<VirtualHost 192.168.48.156:443> ServerName example.com ServerAlias http://www.example.com DocumentRoot /home/example/public_html ServerAdmin webmaster@example.comroot@nerv [~]#


Here is the original:


root@nerv [~]# cat /scripts/uf#!/bin/bash# cpanel4 - scripts Copyright(c) 1997-2002 cPanel, Inc..# All rights Reserved.# copyright@cpanel.net http://cpanel.net# This code is subject to the cpanel license. Unauthorized copying is prohibitedquery="$1"find=`echo "$query" | awk -F: '{ print $1 }'`cat /etc/httpd/conf/httpd.conf | grep $find -2root@nerv [~]#


I'd like to see this script restored to its original form or updated with improved (but not altered) functionality.


Thanks!

-Brant

Replies (1)

photo
1

Also, including in your toolkit the following both optmizes it and makes the command into a 'one-liner'


One could even set it up in your bashrc.function uf {query="$1"; grep $(echo "$query" | awk -F: '{ print $1 }') -2 /etc/httpd/conf/httpd.conf

}

uf example.com


that being said I support the restoration of /scripts/uf

Leave a Comment
 
Attach a file