More updates for cPanel
[clearscm.git] / rc / client_scripts / cPanel
1 #!/bin/bash
2 ################################################################################
3 #
4 # File:         $RCSfile: cPanel,v $
5 # Revision:     $Revision: 1.0 $
6 # Description:  Client specific start up for cPanel
7 # Author:       Andrew@DeFaria.com
8 # Created:      Fri Nov  8 13:50:01 PST 2013
9 # Modified:     $Date: $
10 # Language:     bash
11 #
12 # (c) Copyright 2013, ClearSCM, Inc., all rights reserved.
13 #
14 ################################################################################
15 prepend_to_path /usr/local/cpanel/build-tools
16 prepend_to_path /usr/local/cpanel/3rdparty/lib/path-bin
17 prepend_to_path /usr/local/cpanel/3rdparty/bin
18 prepend_to_path /usr/local/cpanel/bin
19 append_to_path /usr/local/sbin
20 append_to_path /usr/local/bin
21 append_to_path /usr/sbin
22 append_to_path /opt/cpanel/composer/bin
23 append_to_path /opt/cplint/bin
24 append_to_path /root/bin
25
26 # Find code!
27 codePath=$(dirname $(find ~/.vscode-server/bin -name code))
28
29 if [ -n "$codePath" ]; then
30   append_to_path $codePath
31 else
32   echo "Warning - unable to find code"
33 fi
34
35 # Intended to be used for root
36 WIZARD="CPanel"
37
38 export CDPATH=/usr/local
39 export ulc=/usr/local/cpanel
40 export ulp=/usr/local/cp-monitoring-cpanel-plugin
41 export ulw=/usr/local/cp-monitoring-whm-plugin
42 export ulb=/usr/local/cp-banners-plugin
43 export CPANEL_TEAM='scrum'
44
45 #alias ulc="cd /usr/local/cpanel"
46 alias perl="$ulc/3rdparty/bin/perl"
47
48 # Unset PERLTIDY and PERLCRITIC as those variable override looking for
49 # ~/.perltidyrc and ~/.perlcriticrc.
50 unset PERLTIDY
51 unset PERLCRITIC
52
53 # This is the completer function for ulc. This completes any path that comes
54 # after the ulc as a path completion relative to $ulc
55 function _ulc {
56   local cur prev
57
58   COMPREPLY=()
59   cur="${COMP_WORDS[COMP_CWORD]}"
60   prev="${COMP_WORDS[COMP_CWORD-1]}"
61
62   # to be continued
63 } # _ulc
64
65 function ulc {
66   path=$1
67
68   if [ -s "$1" ]; then
69     cd $ulc/$path
70   else
71     cd $ulc
72   fi
73 } # ulc
74
75 function ulp {
76   path=$1
77
78   if [ -s "$1" ]; then
79     cd $ulp/$path
80   else
81     cd $ulp
82   fi
83 } # ulp
84
85
86 function ulw {
87   path=$1
88
89   if [ -s "$1" ]; then
90     cd $ulw/$path
91   else
92     cd $ulw
93   fi
94 } # ulw
95
96 function ulb {
97   path=$1
98
99   if [ -s "$1" ]; then
100     cd $ulb/$path
101   else
102     cd $ulb
103   fi
104 } # ulb
105