Removed execute from 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 if [ -d ~/.vscode-server ]; then
28   codePath=$(dirname $(find ~/.vscode-server/bin -name code))
29   if [ -n "$codePath" ]; then
30     append_to_path $codePath
31   else
32     echo "Warning - unable to find code"
33   fi
34 fi
35
36 # Intended to be used for root
37 WIZARD="CPanel"
38
39 export CDPATH=/usr/local
40 export ulc=/usr/local/cpanel
41 export ulp=/usr/local/cp-monitoring-cpanel-plugin
42 export ulw=/usr/local/cp-monitoring-whm-plugin
43 export ulb=/usr/local/cp-banners-plugin
44 export CPANEL_TEAM='scrum'
45
46 #alias ulc="cd /usr/local/cpanel"
47 alias perl="$ulc/3rdparty/bin/perl"
48
49 # Unset PERLTIDY and PERLCRITIC as those variable override looking for
50 # ~/.perltidyrc and ~/.perlcriticrc.
51 unset PERLTIDY
52 unset PERLCRITIC
53
54 # This is the completer function for ulc. This completes any path that comes
55 # after the ulc as a path completion relative to $ulc
56 function _ulc {
57   local cur prev
58
59   COMPREPLY=()
60   cur="${COMP_WORDS[COMP_CWORD]}"
61   prev="${COMP_WORDS[COMP_CWORD-1]}"
62
63   # to be continued
64 } # _ulc
65
66 function ulc {
67   path=$1
68
69   if [ -s "$1" ]; then
70     cd $ulc/$path
71   else
72     cd $ulc
73   fi
74 } # ulc
75
76 function ulp {
77   path=$1
78
79   if [ -s "$1" ]; then
80     cd $ulp/$path
81   else
82     cd $ulp
83   fi
84 } # ulp
85
86
87 function ulw {
88   path=$1
89
90   if [ -s "$1" ]; then
91     cd $ulw/$path
92   else
93     cd $ulw
94   fi
95 } # ulw
96
97 function ulb {
98   path=$1
99
100   if [ -s "$1" ]; then
101     cd $ulb/$path
102   else
103     cd $ulb
104   fi
105 } # ulb
106