}
+gnupload(){
+ /a/f/gnulib/build-aux/gnupload "$@"
+}
+
# todo, update this
complete -F _longopt la lower low rlt rld rl lld ts ll dircp ex fcp fct fpst gr
# inspired from https://github.com/Russell91/sshrc
- local now args remote dorsync haveinfo tmpa sshinfo tmp tmp2 type info_sec force_rsync
+ local now args remote dorsync haveinfo tmpa sshinfo tmp tmp2 type info_sec force_rsync \
+ sshinfo_dir sync_files_dir sync_files_dir
declare -a args tmpa
+ # This folder stores info about what we detected or synced. We expect it to exist
+ # ahead of time. Change it for your own system.
+ sshinfo_dir=/p/sshinfo
+
+ # This folder should contain files or symlinks to all files that
+ # should be rsynced to unknown hosts. The directory name is important,
+ # it will be created on the remote host under /root. symlinks will be
+ # resolved. It is expected to contain at least a .bashrc file or
+ # symlink.
+ sync_files_dir=/b/ds/sl/.iank
+ sync_dirname=${sync_files_dir##*/}
+
now=$(date +%s)
# ssh [-1246Antivivisectionist] [-b bind_address] [-c cipher_spec] [-D [bind_address:]port]
fi
dorsync=false
haveinfo=false
- tmpa=(/p/sshinfo/???????????"$remote")
+
+ tmpa=($sshinfo_dir/???????????"$remote")
sshinfo=${tmpa[0]}
if [[ -e $sshinfo ]]; then
if $force_rsync; then
type=${tmp2: -1}
if [[ $type == b ]]; then
info_sec=${tmp::10}
- for f in /b/ds/sl/.iank/*; do
+ for f in $sync_files_dir/*; do
if (( $(stat -L -c%Y $f) > info_sec )); then
dorsync=true
rm -f $sshinfo
fi
else
# use this weird yes thing to ensure we know ssh succeeded
- if ! tmp=$(command ssh "${args[@]}" "$remote" "if test -e /a/bin/ds/.bashrc -a -L .bashrc; then echo yes; fi"); then
+ if ! tmp=$(command ssh "${args[@]}" "$remote" "if test -e $sync_files_dir/.bashrc -a -L .bashrc; then echo yes; fi"); then
echo failed sl test. doing plain ssh -v
command ssh -v "${args[@]}" "$remote"
fi
fi
fi
if $dorsync; then
- RSYNC_RSH="ssh ${args[*]}" rsync -rptL /b/ds/sl/.iank "$remote":
+ RSYNC_RSH="ssh ${args[*]}" rsync -rptL $sync_files_dir "$remote":
fi
if $dorsync || ! $haveinfo; then
- sshinfo=/p/sshinfo/$now$type"$remote"
+ sshinfo=$sshinfo_dir/$now$type"$remote"
touch $sshinfo
chmod 666 $sshinfo
fi
# Theres a couple ways to do this. im not sure whats best,
# but relying on bash 4.4+ escape quoting seems most reliable.
command ssh "${args[@]}" "$remote" \
- BRC=t bash -c '.\ .iank/.bashrc\;"\"\$@\""' bash ${@@Q}
+ BRC=t bash -c '.\ '$sync_dirname'/.bashrc\;"\"\$@\""' bash ${@@Q}
elif [[ ! -t 0 ]]; then
# This case is when commands are being piped to ssh.
# Normally, no bashrc gets sourced.
# But, since we are doing all this, lets source it because we can.
- cat <(echo . .iank/.bashrc) - | command ssh "${args[@]}" "$remote" BRC=t bash
+ cat <(echo . $sync_dirname/.bashrc) - | command ssh "${args[@]}" "$remote" BRC=t bash
else
- command ssh -t "${args[@]}" "$remote" BRC=t INPUTRC=.iank/.inputrc bash --rcfile .iank/.bashrc
+ command ssh -t "${args[@]}" "$remote" BRC=t INPUTRC=$sync_dirname/.inputrc bash --rcfile $sync_dirname/.bashrc
fi
else
if [[ -t 0 ]]; then
#keyserver hkp://pool.sks-keyservers.net
#keyserver hkp://keys.openpgp.org
-keyserver hkp://pgp.mit.edu
+#keyserver hkp://pgp.mit.edu
#keyserver hkp://keyserver.pgp.com
#keyserver hkp://ipv4.pool.sks-keyservers.net
-#keyserver hkp://keys.gnupg.net
+keyserver hkp://keys.gnupg.net
#keyserver hkp://keyserver.ubuntu.com
#keyserver hkp://keyring.debian.org
#keyserver keyserver.ubuntu.com