/
etc
/
profile.d
/
/etc/profile.d
mkdir
upload
Name
Size
Mode
Actions
bash_completion.sh
664
0644
edit
dl
rm
bash_timestamps.sh
69
0644
edit
dl
rm
colorgrep.csh
196
0644
edit
dl
rm
colorgrep.sh
201
0644
edit
dl
rm
colorls.csh
1741
0644
edit
dl
rm
colorls.sh
1606
0644
edit
dl
rm
colorsysstat.csh
69
0644
edit
dl
rm
colorsysstat.sh
56
0644
edit
dl
rm
colorxzgrep.csh
162
0644
edit
dl
rm
colorxzgrep.sh
183
0644
edit
dl
rm
colorzgrep.csh
216
0644
edit
dl
rm
colorzgrep.sh
220
0644
edit
dl
rm
cpanel-user-commands.sh
358
0644
edit
dl
rm
csh.local
80
0644
edit
dl
rm
debuginfod.csh
674
0644
edit
dl
rm
debuginfod.sh
596
0644
edit
dl
rm
dedrads.sh
85
0644
edit
dl
rm
gawk.csh
1107
0644
edit
dl
rm
gawk.sh
757
0644
edit
dl
rm
imh-sys-snap.sh
94
0644
edit
dl
rm
lang.csh
2489
0644
edit
dl
rm
lang.sh
2312
0644
edit
dl
rm
less.csh
500
0644
edit
dl
rm
less.sh
253
0644
edit
dl
rm
locallib.csh
240
0755
edit
dl
rm
locallib.sh
272
0755
edit
dl
rm
modules.csh
105
0644
edit
dl
rm
modules.sh
448
0644
edit
dl
rm
rads-autocomplete.sh
8559
0644
edit
dl
rm
scl-init.csh
284
0644
edit
dl
rm
scl-init.sh
637
0644
edit
dl
rm
sh.local
81
0644
edit
dl
rm
vim.csh
106
0644
edit
dl
rm
vim.sh
248
0644
edit
dl
rm
which2.csh
120
0644
edit
dl
rm
which2.sh
628
0644
edit
dl
rm
wp-cli-include.sh
58
0644
edit
dl
rm
wp3.sh
3012
0644
edit
dl
rm
Edit:
/etc/profile.d/rads-autocomplete.sh
(8559B)
# :vim set ts=4 sw=4 expandtab syntax=sh: # # IMH RADS bash autocomplete # Rev 2 (08 Feb 2016) # J. Hipps <jacobh@inmotionhosting.com> # # Check if the directory /usr/local/cpanel/bin exists. # Exit the script if it does not. [ ! -d "/usr/local/cpanel/bin" ] && return ############################################################################### ## account-review ## check_cpu ## unsuspend_user ## fixperms ## switch ## send_pp_email __autocomplete_user() { local cur prev words cword words="$COMP_WORDS" cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" cword=$COMP_CWORD # auto-complete username COMPREPLY=( $(compgen -W "$(sudo \ls /var/cpanel/users/)" -- $cur) ) } complete -F __autocomplete_user account-review complete -F __autocomplete_user check_cpu complete -F __autocomplete_user unsuspend_user complete -F __autocomplete_user fixperms complete -F __autocomplete_user switch complete -F __autocomplete_user send_pp_email complete -F __autocomplete_user hostsfilemods ############################################################################### ## whoowns _whoowns() { local cur prev words cword words="$COMP_WORDS" cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" cword=$COMP_CWORD # auto-complete domain names COMPREPLY=( $(compgen -W "$(sudo cat /etc/userdomains | awk -F: '{print $1}' | grep -v '^\*$')" -- $cur) ) } complete -F _whoowns whoowns ############################################################################### ## modify-account _modify_account() { local cur prev words cword words="$COMP_WORDS" cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" cword=$COMP_CWORD # option lists opListLong="--new-user --owner --password --domain --theme --cgi --no-cgi --shell --no-shell --ip --package --bandwidth --quota --reseller --no-reseller --acl --self --no-self --ns --custom-ns --allow --deny --force" opListShort="-u -o -w -d -t -c -s -i -p -b -q -r -a -D -b -h -v" opSysOps="--list-users --list-themes --list-ips --list-packages --list-resellers --list-acls --summary --info --debug --bleach --no-color --man --help --version" # auto-complete username if [[ $cword == 1 ]]; then COMPREPLY=( $(compgen -W "$(\ls /var/cpanel/users/)" -- $cur) ) return 0 fi # auto-complete options if [[ "$cur" == -* ]]; then COMPREPLY=( $(compgen -W "$opListLong $opListShort $opSysOps" -- $cur) ) return 0 fi # param completion case "$prev" in -p|-a|--package|--acl) COMPREPLY=( $(compgen -W "$(\ls -p /var/cpanel/packages/ | grep -v /)" -- $cur) ) return 0 ;; -i|--ip) COMPREPLY=( $(compgen -W "$(ip a s | grep inet | grep -v -E '(127.0.0.1|inet6| 192.168)' | awk '{print $2}' | sed 's/\/.*//')" -- $cur) ) return 0 ;; -o|--owner) COMPREPLY=( $(compgen -W "$(cat /var/cpanel/resellers | awk -F: '{print $1}')" -- $cur) ) return 0 ;; esac } complete -F _modify_account modify-account ############################################################################### ## check_user ## check_crons _check_user() { local cur prev words cword words="$COMP_WORDS" cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" cword=$COMP_CWORD opListLong="--recent --full" opListShort="" # auto-complete options if [[ "$cur" == -* ]]; then COMPREPLY=( $(compgen -W "$opListLong $opListShort" -- $cur) ) return 0 fi # auto-complete username COMPREPLY=( $(compgen -W "$(sudo \ls /var/cpanel/users/)" -- $cur) ) } complete -F _check_user check_user complete -F _check_user check_crons ############################################################################### ## nlp _nlp() { local cur prev words cword words="$COMP_WORDS" cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" cword=$COMP_CWORD opListLong="--with-ptr --no-ptr" opListShort="-n -w -p -P -h" # auto-complete options if [[ "$cur" == -* ]]; then COMPREPLY=( $(compgen -W "$opListLong $opListShort" -- $cur) ) return 0 fi # auto-complete domlogs path if [ -f /etc/cpanel/ea4/is_ea4 ]; then DOMLOGS_PATH=/var/log/apache2/domlogs else DOMLOGS_PATH=/usr/local/apache/domlogs fi if [[ "$cur" == /* ]]; then COMPREPLY=( $(compgen -W "$(find $DOMLOGS_PATH/*)" -- $cur) ) return 0 fi # auto-complete username COMPREPLY=( $(compgen -W "$(sudo \ls /var/cpanel/users/)" -- $cur) ) } complete -F _nlp nlp ############################################################################### ## suspend_user _suspend_user() { local cur prev words cword words="$COMP_WORDS" cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" cword=$COMP_CWORD opListLong="--sched --moved --tos --ra --cancel --billing --orphan" opListShort="-u -m" # auto-complete username if [ $cword == 1 ] || [ "$prev" == "-u" ]; then COMPREPLY=( $(compgen -W "$(\ls /var/cpanel/users/)" -- $cur) ) return 0 fi # auto-complete options if [[ "$cur" == -* ]]; then COMPREPLY=( $(compgen -W "$opListLong $opListShort" -- $cur) ) return 0 fi } complete -F _suspend_user suspend_user ############################################################################### ## check_exim _check_exim() { local cur prev words cword words="$COMP_WORDS" cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" cword=$COMP_CWORD opListLong="--dirtotals --listdirs --queuebysender --queuebybounceback --bouncesbydomain --recipientisp --recipienttest --fullmbox --fwdtotals --lines --status" opListShort="-h" # auto-complete options if [[ "$cur" == -* ]]; then COMPREPLY=( $(compgen -W "$opListLong $opListShort" -- $cur) ) return 0 fi } complete -F _check_exim check_exim ############################################################################### ## check_mysql _check_mysql() { local cur prev words cword words="$COMP_WORDS" cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" cword=$COMP_CWORD opListLong="--sockets --active --kill --killqueries --killselects" opListShort="-h" # auto-complete username if [[ "$prev" == "--kill" ]]; then COMPREPLY=( $(compgen -W "$(sudo \ls /var/cpanel/users/)" -- $cur) ) return 0 fi # auto-complete options if [[ "$cur" == -* ]]; then COMPREPLY=( $(compgen -W "$opListLong $opListShort" -- $cur) ) return 0 fi } complete -F _check_mysql check_mysql ############################################################################### ## shellscan _shellscan() { local cur prev words cword words="$COMP_WORDS" cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" cword=$COMP_CWORD opListLong="--listsigs --dir --user --signame --matches --outfile --auto-quarantine --no-quarantine" opListShort="-l -d -u -s -m -o -h -y -n" # auto-complete username if [ "$prev" == "-u" ] || [ "$prev" == "--user" ]; then COMPREPLY=( $(compgen -W "$(sudo \ls /var/cpanel/users/)" -- $cur) ) return 0 fi # auto-complete options if [[ "$cur" == -* ]]; then COMPREPLY=( $(compgen -W "$opListLong $opListShort" -- $cur) ) return 0 fi } complete -F _shellscan shellscan.py ############################################################################### ## disk_cleanup.py _disk_cleanup() { local cur prev words cword words="$COMP_WORDS" cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" cword=$COMP_CWORD opModes="delete note" delOptsLong="--help --core --zip --backup --softaculous --temp" delOptsShort="-h -c -z -b -s -t -a" noteOptsLong="--help --wordpress" noteOptsShort="-h -w" # auto-complete operation modes if [[ $cword == 1 ]]; then COMPREPLY=( $(compgen -W "$opModes" -- $cur) ) return 0 fi # auto-complete options for each op mode case "$prev" in delete) COMPREPLY=( $(compgen -W "$delOptsLong $delOptsShort" -- $cur) ) return 0 ;; note) COMPREPLY=( $(compgen -W "$noteOptsLong $noteOptsShort" -- $cur) ) return 0 ;; esac } complete -F _disk_cleanup disk_cleanup.py
Save
cmd:
run