Yerbacon/scripts/postinst

29 lines
753 B
Plaintext
Raw Normal View History

#!/bin/sh
# Post install ybcon script
2021-03-03 13:35:55 +01:00
ybconDir="/opt/share/ybcon.d"
ln -sf "/opt/yerbacon/bin/ybcon" "/usr/bin/ybcon"
fishLoc="/usr/share/fish/vendor_completions.d"
bashcompleteLoc="/etc/bash_completion.d"
zshLoc="/etc/zsh_completion.d"
if [ -d $bashcompleteLoc ]; then
ln -sf "$ybconDir/completions/bash-completion.sh" "$bashcompleteLoc/ybcon.sh"
fi
if [ -f "/usr/bin/fish" ]; then
if [ ! -d $fishLoc ]; then
mkdir "$fishLoc"
fi
ln -sf "$ybconDir/completions/fish-completion.fish" "$fishLoc/ybcon.fish"
fi
zshBin="/usr/bin/zsh"
if [ -f $zshBin ]; then
if ! [ -d $zshLoc ]; then
zshLoc="/usr/share/zsh/vendor-completions"
fi
if [ -d $zshLoc ]; then
ln -sf "$ybconDir/completions/zsh-completion.zsh" "$zshLoc/_ybcon"
fi
fi