dotfiles/.config/bash/iridion.bash

32 lines
703 B
Bash
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

set -o pipefail
list() {
type="$1"
shift
if test $# -eq 0 && echo $type | grep -q -- '-domains$'
then for user in $(list users)
do test -t 1 && echo "$user"
list "$type" "$user"
done
else if test -t 1
then sudo "/usr/local/hestia/bin/v-list-$type" "$@" | column -t
else sudo "/usr/local/hestia/bin/v-list-$type" "$@" | tail +3 | awk '{print $1}'
fi
fi
}
hestia() {
test $# -eq 0 && cd /usr/local/hestia && return 0
set -x
command=$1
shift
sudo $(which $command) "$@"
set +x
}
accessible() {
dir=/home/*/web/$1/public_html
sudo chmod -v 755 $dir
sudo chown -v :sudo $dir
}