&& [[ ! $SSH_TTY ]] \
&& [[ $- != *i* ]] \
&& [[ ! $BASH_LOGIN_SHELL == true ]]; then
- return
+ return 0
else
if [[ -r /etc/profile ]]; then
source /etc/profile
source $_x
fi
fi
+# ensure no bad programs appending to this file will have an affect
+return 0
# see .bashrc_profile for commentary
echo this is ~/.profile, either my .bashrc_profile is unavailable or this is posix mode or not bash
+
+# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
+export PATH="$PATH:$HOME/.rvm/bin"
+
+[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
# eval "$(pyenv virtualenv-init -)"
#fi
-# id prefer to have system-wide, plus user ruby, due to bug in it
-# https://github.com/rubygems/rubygems/pull/1002
-# further problems: installing multi-user ruby and user ruby,
-# you dont get multi-user ruby when you sudo to root, unless its sudo -i.
-# There a third hybrid form, which passenger error suggested I use,
-# but it didnt actually work.
-
-# in cased I never need this
-# rvm for non-interactive shell: modified from https://rvm.io/rvm/basics
-#if [[ $(type -t rvm) == file && ! $(type -t ruby) ]]; then
-# source $(rvm 1.9.3 do rvm env --path)
-#fi
-
-# based on warning from rvmsudo
-export rvmsudo_secure_path=1
-if [[ -s "/usr/local/rvm/scripts/rvm" ]]; then
- source "/usr/local/rvm/scripts/rvm"
-elif [[ -s $HOME/.rvm/scripts/rvm ]]; then
- source $HOME/.rvm/scripts/rvm
-fi
export GOPATH=$HOME/go
path_add $GOPATH/bin
path_add --end ~/.npm-global
+# taken from default changes to bashrc and bash_profile
+path_add --end $HOME/.rvm/bin
+[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
+
export BASEFILE_DIR=/a/bin/fai-basefiles
# didnt get drush working, if I did, this seems like the
usage() {
cat <<'EOF'
btrbk-run [OPTIONS]
-usually -t TARGET_HOST
+usually -t TARGET_HOST or -s SOURCE_HOST
+
+Note, at source location, intentionally not executable, run and read
+install-my-scripts.
+
EOF
echo "top of script file:"
sed -n '1,/^[# ]*end command line/{p;b};q' "$0"
cat <<EOF
usage: $0 SUBVOL_MOUNTPOINT...
-In git, this is not not executable because it's meant to be installed
+In git this is not not executable because it's meant to be installed
using ./install-my-scripts
If latest subvols \$@ are not mounted, exit 1, print message, and print
[[ $- == *i* ]] || interactive=false
if ! $interactive; then
set -x
- set -e -o pipefail
fi
-set -E
-trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?"' ERR
-for x in /a/bin/errhandle/*-function; do
- source $x
-done
-set +e
-$interactive || errcatch
+source /a/bin/errhandle/err
### setup logging
exec &> >(sudo tee -a /var/log/distro-begin)
set +x
source /a/bin/distro-functions/src/identify-distros
$interactive || set -x
-for f in iank-dev htpc kd x2 frodo tp li lj demohost kw fz; do
+for f in iank-dev htpc kd x2 x3 frodo tp li lj demohost kw fz; do
eval "$f() { [[ $HOSTNAME == $f ]]; }"
done
has_p() { ! linode; } # when tp is tracis, then not tp either
###### bash environment setup
set +x
-errallow
+err-allow
source /etc/profile.d/environment.sh
source ~/.bashrc
-$interactive || errcatch
+err-catch
$interactive || set -x
fi
s lnf /q/root/.editor-backups /q/root/.undo-tree-history \
/a/opt /a/c/.emacs.d $HOME/mw_vars /k/backup /root
+pi rsync # needed for rootsshsync
rootsshsync
s lnf /a/c/.vim /a/c/.vimrc /a/c/.gvimrc /root
if has_p; then
fi
##### install laptop hardware packages
-if tp || x2; then
+if tp || x2 || x3; then
case $distro in
debian)
pi task-laptop
# s cp -r --parents /etc/openvpn/easy-rsa/keys /p/c/filesystem
# s chown -R 1000:1000 /p/c/filesystem/etc/openvpn/easy-rsa/keys
# # kw = kgpe work machine.
-# for host in x2 kw; do
+# for host in x2 x3 kw; do
# vpn-mk-client-cert -b $host -n home b8.nz 1196
# dir=/p/c/machine_specific/$host/filesystem/etc/openvpn/client
# mkdir -p $dir
Package: *
Pin: release a=xenial-updates
Pin-Priority: -100
+
+Package: *
+Pin: release a=xenial-security
+Pin-Priority: -100
EOF
s dd of=/etc/apt/sources.list.d/xenial.list 2>/dev/null <<EOF
deb http://us.archive.ubuntu.com/ubuntu/ xenial main
deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates main
+deb http://us.archive.ubuntu.com/ubuntu/ xenial-security main
EOF
curl http://archive.ubuntu.com/ubuntu/project/ubuntu-archive-keyring.gpg | s apt-key add -
p update
t=$(mktemp -d)
cd $t
- s dd of=/etc/apt/preferences.d/flidas-xenial <<EOF
-Package: debootstrap
-Pin: release a=xenial
-Pin-Priority: 1001
-
-Package: debootstrap
-Pin: release a=xenial-updates
-Pin-Priority: 1001
-EOF
aptitude download debootstrap
ex *
ex data.tar.gz
# EOF
# s systemctl daemon-reload
# case $HOSTNAME in
-# x2|tp)
+# x2|x3|tp)
# ser enable synergyc@iank
# ser start synergyc@iank ||: # X might not be running yet
# ;;
e() { echo "$*"; "$@"; }
# scripts that would interfere with unmounting /a, put them elsewhere
-e install mount-latest-subvol check-subvol-stale /usr/local/bin
+e install btrbk-run mount-latest-subvol check-subvol-stale /usr/local/bin
# limitations under the License.
# usage: mount-latest-subvol
+#
+# Note, at source location, intentionally not executable, run and read
+# install-my-scripts.
cd /
[[ $EUID == 0 ]] || exec sudo -E "$BASH_SOURCE" "$@"
for p in ${pids}; do
for m in ${my_pids[@]}; do
if (( p == m )); then
- echo "$0: error: pids to kill includes our pid or a parent" >&2
+ echo "$0: error: pids to kill includes our pid or a parent. ps output:" >&2
ps -f -p $p
exit 1
fi
# install -o iank -g iank -d -m700 /home/iank/gpg-agent-socket
# because something keeps deleting that directory
-# default keyserver
+# default keyserver. i switch around randomly to find one that is up.
#
#keyserver hkp://pgp.mit.edu
-# this one seems more reliable, but it's down now
-keyserver hkp://pool.sks-keyservers.net
+#keyserver hkp://pool.sks-keyservers.net
+#keyserver hkp://keyserver.pgp.com
+keyserver hkp://ipv4.pool.sks-keyservers.net
# more secure, but had problems with my gpg version
#keyserver hkps://hkps.pool.sks-keyservers.net