iankelling.org
/
git
/
distro-setup
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
da8b091
)
fix switch-host2
author
Ian Kelling
<ian@iankelling.org>
Thu, 18 Apr 2024 14:28:57 +0000
(10:28 -0400)
committer
Ian Kelling
<ian@iankelling.org>
Thu, 18 Apr 2024 14:28:57 +0000
(10:28 -0400)
switch-mail-host
patch
|
blob
|
history
diff --git
a/switch-mail-host
b/switch-mail-host
index b0b35a612a8e42decdd2f23f5bd387f2dbaa1db2..56676b9b408d487651b93a3f18ddc71efaf5ba6c 100644
(file)
--- a/
switch-mail-host
+++ b/
switch-mail-host
@@
-134,6
+134,26
@@
source /a/bin/bash_unpublished/source-state
direction=$1
host=$2
direction=$1
host=$2
+case $script_name in
+ switch-mail-host)
+ if [[ $MAIL_HOST != "$HOST2" ]]; then
+ mail_only=true
+ fi
+ ;;
+ switch-host2)
+ host2_only=true
+ ;;
+ *)
+ err unexpected script name
+ ;;
+esac
+
+if $mail_only; then
+ mp_args="-m /o"
+elif $host2_only; then
+ mp_args="-m /a,/q,/qd,/qr"
+fi
+
if ! $force && { $check_installed || [[ $direction == push ]]; } ; then
install_bin_files=(
if ! $force && { $check_installed || [[ $direction == push ]]; } ; then
install_bin_files=(
@@
-196,7
+216,7
@@
case $direction in
fi
done
if $diff; then
fi
done
if $diff; then
- e "found different version on old_host=$old_host
name
, reexecing"
+ e "found different version on old_host=$old_host, reexecing"
m /usr/local/bin/switch-mail-host --pull-reexec "${orig_args[@]}"
exit 0
fi
m /usr/local/bin/switch-mail-host --pull-reexec "${orig_args[@]}"
exit 0
fi
@@
-218,25
+238,6
@@
case $direction in
;;
esac
;;
esac
-case $script_name in
- switch-mail-host)
- if [[ $MAIL_HOST != "$HOST2" ]]; then
- mail_only=true
- fi
- ;;
- switch-host2)
- host2_only=true
- ;;
- *)
- err unexpected script name
- ;;
-esac
-
-if $mail_only; then
- mp_args="-m /o"
-elif $host2_only; then
- mp_args="-m /a,/q,/qd,/qr"
-fi
if ! $force; then
if $host2_only; then
if ! $force; then
if $host2_only; then
@@
-288,12
+289,13
@@
while $active; do
done
done
done
done
-# ensure these are unused before doing anything
-e "On $new_host: umounting /m and /o, checking emacs"
-{
- cat /usr/local/bin/unsaved-buffers
- if ! $host2_only; then
- cat <<EOF
+if ! $host2_only; then
+ # ensure these are unused before doing anything
+ e "On $new_host: umounting /m and /o, checking emacs"
+ {
+ cat /usr/local/bin/unsaved-buffers
+ if ! $host2_only; then
+ cat <<EOF
for dir in m o; do
if mountpoint -q /\$dir; then
echo On $new_host: umount /\$dir
for dir in m o; do
if mountpoint -q /\$dir; then
echo On $new_host: umount /\$dir
@@
-301,8
+303,9
@@
for dir in m o; do
fi
done
EOF
fi
done
EOF
- fi
-} | $new_shell bash -s
+ fi
+ } | $new_shell bash -s
+fi
if ! $mail_only; then
cat /usr/local/bin/unsaved-buffers - <<'EOF' | $old_shell bash -s
if ! $mail_only; then
cat /usr/local/bin/unsaved-buffers - <<'EOF' | $old_shell bash -s