2018-07-21 05:03:42 +00:00
|
|
|
#!/bin/bash
|
|
|
|
# Description: Password Store
|
|
|
|
set -e
|
|
|
|
|
|
|
|
case $_PLATFORM in
|
|
|
|
darwin)
|
|
|
|
_recipe brew
|
|
|
|
_brew pass
|
2020-09-05 04:29:14 +00:00
|
|
|
_brew pass-otp
|
2018-07-21 05:03:42 +00:00
|
|
|
;;
|
2021-02-05 00:05:51 +00:00
|
|
|
arch)
|
|
|
|
_recipe _arch
|
|
|
|
_pacman pass
|
|
|
|
_pacman pass-otp
|
|
|
|
;;
|
|
|
|
debian)
|
2018-07-21 05:03:42 +00:00
|
|
|
_recipe _apt
|
|
|
|
_apt pwgen
|
|
|
|
_apt tree
|
|
|
|
_apt xclip
|
2020-09-05 04:29:14 +00:00
|
|
|
_apt oathtool
|
|
|
|
_apt zbar-tools
|
|
|
|
|
2018-07-21 05:03:42 +00:00
|
|
|
if [ ! -x /usr/bin/pass ]; then
|
|
|
|
dir=`mktemp -d` && \
|
|
|
|
pushd $dir >/dev/null
|
|
|
|
echo "[tgz] Fetching password-store"
|
|
|
|
curl -sL https://git.zx2c4.com/password-store/snapshot/password-store-master.tar.xz \
|
|
|
|
| tar x -J --strip 1 && \
|
|
|
|
echo "[tgz] Installing password-store" && \
|
2018-07-21 06:55:23 +00:00
|
|
|
sudo make install \
|
|
|
|
ZSHCOMPDIR=/usr/share/zsh/vendor-completions \
|
|
|
|
>/dev/null 2>&1
|
2018-07-21 05:03:42 +00:00
|
|
|
popd >/dev/null
|
|
|
|
rm -rf "$dir"
|
|
|
|
else
|
|
|
|
echo "[tgz] password-store is already installed, skipping."
|
|
|
|
fi
|
2020-09-05 04:29:14 +00:00
|
|
|
if [ ! -x /usr/lib/password-store/extensions/otp.bash ]; then
|
|
|
|
dir=`mktemp -d` && \
|
|
|
|
pushd $dir >/dev/null
|
|
|
|
echo "[tgz] Fetching pass-otp"
|
|
|
|
curl -sL https://github.com/tadfisher/pass-otp/tarball/develop \
|
|
|
|
| tar x -z --strip 1 && \
|
|
|
|
echo "[tgz] Installing pass-otp" && \
|
|
|
|
sudo make install >/dev/null 2>&1
|
|
|
|
popd >/dev/null
|
|
|
|
rm -rf "$dir"
|
|
|
|
else
|
|
|
|
echo "[tgz] pass-otp is already installed, skipping."
|
|
|
|
fi
|
2018-07-21 05:03:42 +00:00
|
|
|
esac
|