various fixes, mostly for etiona
authorIan Kelling <ian@iankelling.org>
Tue, 12 Nov 2019 17:55:15 +0000 (12:55 -0500)
committerIan Kelling <ian@iankelling.org>
Tue, 12 Nov 2019 17:55:15 +0000 (12:55 -0500)
14 files changed:
brc
brc2
btrbk-run
conflink
desktop-20-autostart.sh
distro-begin
distro-end
distro-pkgs
filesystem/etc/systemd/system/fsf-vpn-dns-cleanup.service
mail-route
mail-setup
pkgs
sl/.iank/package-manager-abstractions [new symlink]
switch-mail-host

diff --git a/brc b/brc
index b5d45969c67b9364d6dfc783d187be1873d27707..51a04dcac0d59c3a29bd081522ee11a51dc738da 100644 (file)
--- a/brc
+++ b/brc
@@ -317,7 +317,7 @@ cam() {
 
 
 ccat () { # config cat. see a config without extra lines.
-  grep '^\s*[^;[:space:]#]' "$@"
+  grep '^\s*[^;[:space:]#]' "$@" || [[ $? == 1 ]]
 }
 
 
@@ -768,11 +768,11 @@ lower() { # make first letter of filenames lowercase.
 
 
 k() { # history search
-  grep -P --binary-files=text "$@" ${HISTFILE:-~/.bash_history}  | tail -n 80;
+  grep -P --binary-files=text "$@" ${HISTFILE:-~/.bash_history}  | tail -n 80 || [[ $? == 1 ]];
 }
 
 ks() { # history search
-  grep -P --binary-files=text "$@" ${HISTFILE:-~/.bash_history}  | uniq;
+  grep -P --binary-files=text "$@" ${HISTFILE:-~/.bash_history}  | uniq || [[ $? == 1 ]];
 }
 
 
@@ -812,7 +812,7 @@ pkx() { # package extract
   c $(mktemp -d)
   pkg=$1
   # shellcheck disable=SC2012
-  cached=$(ls -t /var/cache/apt/archives/$pkg* | tail -n1 2>/dev/null)
+  cached=$(ls -t /var/cache/apt/archives/$pkg* | tail -n1 2>/dev/null) ||:
   if [[ $cached ]]; then
     cp $cached .
   else
diff --git a/brc2 b/brc2
index 891e0953b668e7e69d847f54e5f4ad24f768fff5..56f4db6c860d4ff83bb91a254ab3a0eb683e33cf 100644 (file)
--- a/brc2
+++ b/brc2
@@ -141,18 +141,20 @@ bigclock() {
 }
 
 _jrun() { # journal run. run args, log to journal, tail and grep the journal.
+  # Redirect all commands which might have stderr to stdout because of
+  # wrapping.
   local pid pattern jr_pid sedscript cmd_name ended
   ret=0
   case $1 in
     -p)
-      pattern="$2\|"
+      pattern="$2|"
       shift 2
       ;;
   esac
   cmd_name=${1##*/}
   systemd-cat -t "$cmd_name" "$@" 2>&1 &
   pid=$!
-  sedscript="/$pattern$cmd_name/p;/^.{16}[^ ]+ $cmd_name\[$pid]: ([^ ]+ +)?exiting with status [0-9]+\$/q"
+  sedscript="/$pattern$cmd_name/p;/^.{16}[^ ]+ $cmd_name\[$pid]: $cmd_name: exiting with status [0-9]+\$/q"
   journalctl -S "4 seconds ago" -f |& sed -nr "$sedscript" 2>&1 &
   jr_pid=$!
   wait $pid 2>&1 || ret=$?
@@ -355,6 +357,8 @@ envload() { # load environment from a previous: export > file
   done < "$file"
 }
 
+failfunc() { asdf a b c; }
+failfunc2() { failfunc d e f; }
 
 # one that comes with distros is too old for newer devices
 fastboot() {
@@ -809,7 +813,7 @@ resolvcat() {
   #hr; echo dnsmasq is $(systemctl is-active dnsmasq)
   f=/var/run/dnsmasq/resolv.conf
   hr; echo $f:;  ccat $f
-  hr; m grr '^ *servers-file *=' /etc/dnsmasq.conf /etc/dnsmasq.d
+  hr; m grr '^ *(servers-file|server) *=|^ *no-resolv *$' /etc/dnsmasq.conf /etc/dnsmasq.d
   f=/etc/dnsmasq-servers.conf
   hr; echo $f:;  ccat $f
 }
index 60f065d62e568732cff437d501a1f108d2792f2f..3a2d2a493495fb2fc422f02b9f5f80b52c632b39 100644 (file)
--- a/btrbk-run
+++ b/btrbk-run
@@ -46,7 +46,7 @@ pre="${0##*/}: "
 m() { if $verbose; then printf "$pre%s\n"  "$*"; fi;  "$@"; }
 e() { printf "$pre%s\n"  "$*"; }
 die() { printf "$pre%s\n" "$*" >&2; echo "exiting with status 1" >&2; exit 1; }
-mexit() { echo "exiting with status $1"; exit $1; }
+mexit() { echo "$pre: exiting with status $1"; exit $1; }
 
 # latest $MAIL_HOST
 if [[ -e /b/bash_unpublished/source-state ]]; then
@@ -59,6 +59,7 @@ mountpoints=()
 
 rsync_mountpoint=/q
 
+ret=0
 # default options
 conf_only=false
 dry_run=false # mostly for testing
@@ -445,7 +446,6 @@ else
   m /a/exe/mount-latest-remote ${targets[@]}
 fi
 
-e btrbk-run COMPLETED with exit status $ret
 mexit $ret
 
 # todo: move variable data we don't care about backing up
index 61291f2b42b643dfc2f68008032e892de501da64..8deae093a7bbee829a72ab1cc590ed8a91390372 100755 (executable)
--- a/conflink
+++ b/conflink
@@ -1,7 +1,7 @@
 #!/bin/bash
 
 source /a/bin/errhandle/err
-errcatch-cleanup() {
+err-cleanup() {
   echo 1 >~/.local/conflink
 }
 
@@ -98,7 +98,7 @@ common-file-setup() {
         # A = preserve acls
         # X = preserve extended attributes
         # i = itemize
-      done < <(s rsync -n -aiSAX --chown=root:root --chmod=g-s \
+      done < <(s rsync -aiSAX --chown=root:root --chmod=g-s \
                  --exclude=/etc/dovecot/users \
                  --exclude='/etc/exim4/passwd*' \
                  --exclude='/etc/exim4/*.pem' \
index ed83642aa02c9a9173695cd846da4e7e7155fb6e..69f455f47d21da37bc5d90d206d4f20427a7c58c 100755 (executable)
 # limitations under the License.
 
 # first 2 alternatives showed under ubuntu 14.04, second 2 under arch at 11/2015
-if [[ -s ~/.bashrc ]];then . ~/.bashrc;fi
 if [[ $1 ]]; then
-    right_monitor_rotation=left
+  right_monitor_rotation=left
 else
-    right_monitor_rotation=normal
+  right_monitor_rotation=normal
 fi
 
 
-xout="$(xrandr)"
+if ! xout="$(xrandr)"; then
+  # under wayland
+  exit 0
+fi
 xe() { echo "$xout"; }
 x=$(xe | grep -Ec '^(DisplayPort-[0123]|DVI-0|DP-[1234]|DVI-I-1) connected')
 if (( x > 2 )); then
-    left=$(xe | sed -rn 's/^(DVI[^ ]+) connected .*/\1/p')
-    dps=( $(xe | sed -rn 's/^(DP-[01234]|DisplayPort-[01234]) connected .*/\1/p') )
+  left=$(xe | sed -rn 's/^(DVI[^ ]+) connected .*/\1/p')
+  dps=( $(xe | sed -rn 's/^(DP-[01234]|DisplayPort-[01234]) connected .*/\1/p') )
 
-    middle=${dps[1]}
-    right=${dps[0]}
-    # on older distros, i needed to swap middle and right.
+  middle=${dps[1]}
+  right=${dps[0]}
+  # on older distros, i needed to swap middle and right.
 
 
-    xrandr --output $left --mode 2560x1600 --pos 0x0 --rotate left \
-           --output $middle --mode 2560x1600 --pos 1600x0 --rotate left \
-           --output $right --mode 2560x1600 --pos 3200x0 --rotate $right_monitor_rotation
+  xrandr --output $left --mode 2560x1600 --pos 0x0 --rotate left \
+         --output $middle --mode 2560x1600 --pos 1600x0 --rotate left \
+         --output $right --mode 2560x1600 --pos 3200x0 --rotate $right_monitor_rotation
 elif (( x == 2 )); then
-    # 3rd monitor not working atm, so doing this.
-    left=$(xe | sed -rn 's/^(DVI[^ ]+) connected .*/\1/p')
-    middle=$(xe | sed -rn 's/^(DP-[01234]|DisplayPort-[01234]) connected .*/\1/p')
-    xrandr --output $left --mode 2560x1600 --pos 0x0 --rotate left \
-           --output $middle --mode 2560x1600 --pos 1600x0 --rotate left
+  # 3rd monitor not working atm, so doing this.
+  left=$(xe | sed -rn 's/^(DVI[^ ]+) connected .*/\1/p')
+  middle=$(xe | sed -rn 's/^(DP-[01234]|DisplayPort-[01234]) connected .*/\1/p')
+  xrandr --output $left --mode 2560x1600 --pos 0x0 --rotate left \
+         --output $middle --mode 2560x1600 --pos 1600x0 --rotate left
 
 fi
 /a/bin/distro-setup/input-setup m
 if isarch; then
-    pulseaudio --start
+  pulseaudio --start
 fi
 
 #indicator-kdeconnect
index 22fff60409d135d21ae76167ae28e2de5a9df3b5..72d4d44f613e6ca7ef521dac93344526fc6a753f 100755 (executable)
@@ -55,14 +55,13 @@ if ! $interactive; then
 fi
 source /a/bin/errhandle/err
 
-errcatch-cleanup() {
+err-cleanup() {
   echo 1 >~/.local/distro-begin
 }
 
 source /a/bin/distro-functions/src/package-manager-abstractions
 
 ### setup logging
-exec &> >(sudo tee -a /var/log/distro-begin)
 echo "$0: $(date): starting now)"
 
 
@@ -326,9 +325,9 @@ pi ${p1[@]}
 
 
 ######## fix evbug bug ######
-case $distro in
-  trisquel|ubuntu)
-    # noticed in flidas.
+case $(debian-codename-compat) in
+  xenial)
+    # noticed in flidas. dunno if it affects any others
     #https://bugs.launchpad.net/ubuntu/+source/module-init-tools/+bug/240553
     #https://wiki.debian.org/KernelModuleBlacklisting
     #common advice when searching is to use /etc/modprobe.d/blacklist.conf,
@@ -353,7 +352,7 @@ if has_p; then
   lnf -T /p/News ~/News
 fi
 sudo /a/exe/lnf /q/root/.editor-backups /q/root/.undo-tree-history \
-  /a/opt /a/c/.emacs.d $HOME/mw_vars /k/backup /root
+     /a/opt /a/c/.emacs.d $HOME/mw_vars /k/backup /root
 /a/bin/ds/install-my-scripts # needed for rootsshsync cronjob
 sudo /a/exe/lnf /a/c/.vim /a/c/.vimrc /a/c/.gvimrc /root
 
@@ -544,31 +543,16 @@ if has_x; then
   esac
 
   ##### setup X autostart
-  if isarch; then
-    # https://wiki.archlinux.org/index.php/Xinitrc
-    for homedir in /home/*; do
-      cp /etc/X11/xinit/xinitrc $homedir/.xinitrc
-      # shellcheck disable=SC2016
-      $sed -ri '/^ *twm\b/,$d' $homedir/.xinitrc
-      tee -a $homedir/.xinitrc <<'EOF'
-/a/bin/desktop-20-autostart.sh
-xsetroot -cursor_name left_ptr
-exec xmonad
-EOF
-    done
-  else
-    # todo, figure this out for arch if we ever try out gnome.
-    # install for multiple display managers in case we use one
-    dir=/etc/gdm3
-    sudo mkdir -p $dir/PostLogin
-    sudo cp /a/bin/distro-setup/desktop-20-autostart.sh $dir/PostLogin/Default
-    sudo mkdir -p /etc/lightdm/lightdm.conf.d
-    sudo dd of=/etc/lightdm/lightdm.conf.d/12-iank.conf <<'EOF'
+  # todo, figure this out for arch if we ever try out gnome.
+  # install for multiple display managers in case we use one
+  dir=/etc/gdm3
+  sudo mkdir -p $dir/PostLogin
+  sudo cp /a/bin/distro-setup/desktop-20-autostart.sh $dir/PostLogin/Default
+  sudo mkdir -p /etc/lightdm/lightdm.conf.d
+  sudo dd of=/etc/lightdm/lightdm.conf.d/12-iank.conf <<'EOF'
 [SeatDefaults]
 session-setup-script=/a/bin/distro-setup/desktop-20-autostart.sh
 EOF
-  fi
-
 fi
 
 ### install and configure wayland
@@ -611,4 +595,5 @@ fi
 
 echo 0 >~/.local/distro-begin
 echo "$0: $(date): ending now"
+echo "exiting with status 0"
 exit 0
index d63d315d3da01c6a275bd2d68dda08ee0fed1e8b..18edaa56b8db4e3485e37f9d327acbdf62c40343 100755 (executable)
@@ -12,15 +12,14 @@ if [[ $EUID == 0 ]]; then
   exit 1
 fi
 
-errcatch-cleanup() {
+err-cleanup() {
   echo 1 >~/.local/distro-end
 }
 
 # shellcheck source=./pkgs
 source $src/pkgs
 
-exec &> >(sudo tee -a /var/log/distro-end)
-echo "$0: $(date): starting now)"
+echo "$0: $(date) starting now)"
 # see example of usage to understand.
 end_msg() {
   local y
@@ -32,9 +31,11 @@ end() {
   echo 0 >~/.local/distro-end
   if $pending_reboot; then
     echo "$0: pending reboot and then finished. doing it now."
+    echo "exiting with status 0"
     sudo reboot now
   else
     echo "$0: $(date): ending now)"
+    echo "exiting with status 0"
   fi
   exit 0
 }
@@ -104,10 +105,10 @@ esac
 
 
 ### begin certbot install ###
-if [[ $distro == debian ]]; then
+if [[ $distro == debian || $codename_compat == bionic ]]; then
   # note, need python-certbot-nginx for nginx, but it depends on nginx,
   # and I'm not installing nginx by default right now.
-  pi certbot python-certbot-apache
+  pi certbot python3-certbot-apache
 elif [[ $codename_compat == xenial ]]; then
   # not packaged in xenial or flidas
   pi software-properties-common
@@ -603,10 +604,23 @@ case $codename_compat in
     # mate doesnt have wayland support yet
     pi task-gnome-desktop
     ;;
+  bionic)
+    pi gnome-core
+    ;;
 esac
 
 
+if [[ $codename_compat == flidas ]]; then
+  # doesnt exist in newer
+  pi gnupg-doc
+fi
 
+if [[ $codename == flidas ]]; then
+  pi abrowser
+else
+  pi firefox
+  sudo ln -sf /usr/bin/firefox /usr/local/bin/abrowser
+fi
 
 # TODO: some of the X programs can be removed from pall when using wayland
 
@@ -617,9 +631,6 @@ esac
 pi ${pall[@]} $(apt-cache search ruby[.0-9]+-doc| awk '{print $1}') $(apt-cache depends gcc|grep -i suggests:| awk '{print $2}') $($src/distro-pkgs)
 
 
-sgo fsf-vpn-dns-cleanup
-
-
 # website is dead june 14 2019. back in october, but meh
 sudo rm -fv /etc/apt/sources.list.d/iridium-browser.list
 # case $distro in
@@ -864,8 +875,8 @@ fi
 
 case $codename in
   flidas)
-
-  ;;
+    :
+    ;;
 esac
 
 
@@ -1264,8 +1275,6 @@ sudo gpasswd -a $USER lpadmin # based on ubuntu wiki
 # in arch, I had to pick out the 6L driver.
 
 
-# allow user to run vms, from debian handbook
-for x in iank user2; do s usermod -a -G libvirt,kvm $x; done
 # bridge networking as user fails. google lead here, but it doesn\'t work:
 # oh well, I give up.
 # http://wiki.qemu.org/Features-Done/HelperNetworking
@@ -1284,7 +1293,8 @@ m /a/bin/buildscripts/rust
 m /a/bin/buildscripts/misc
 
 pi-nostart virtinst virt-manager
-
+# allow user to run vms, from debian handbook
+for x in iank user2; do s usermod -a -G libvirt,kvm $x; done
 
 
 pi --no-install-recommends kdeconnect
@@ -1358,6 +1368,7 @@ DEVICESCAN -a -o on -S on -n standby,q $sched \
 
 ########### misc stuff
 
+pi-nostart network-manager
 # make networkmanager use resolvconf instead of its own dnsmasq which
 # conflicts with the normal dnsmasq package.
 f=/etc/NetworkManager/NetworkManager.conf
@@ -1373,6 +1384,7 @@ fi
 # displays l and I as the same char, grrrrr.
 sudo fc-cache
 
+pi desktop-file-utils
 m /a/bin/distro-setup/mymimes
 
 
index b69af1a68933b2a0573702924cb428b5e5615bb4..ab6fa6495689aecb723f9ca561d9ee368b049e46 100755 (executable)
@@ -154,12 +154,6 @@ case $distro in
   *) : ;; # comes default or with other packages
 esac
 
-case $distro in
-  arch) e firefox pulseaudio ;;
-  trisquel) e abrowser ;;
-  *) : ;; # comes default or with other packages, or uknown
-esac
-
 
 case $distro in
   arch) e ttf-dejavu ;;
index 3e50599bc9d5f2a8e202d503e633be1ffc0425c6..2f6d9bb8fca34f0057ad1899d0a27325d0595428 100644 (file)
@@ -1,9 +1,8 @@
 # If we reboot, or the vpn dies in an unusual way, it leaves dnsmasq config hanging around.
-# This cleans that up.
 [Unit]
 Description=fsf-vpn-dns-cleanup
 After=multi-user.target
-Conflicts=openvpn-client@fsf80.service openvpn-client@fsf802.service openvpn-client@fsf803.service openvpn-client@fsf443.service openvpn-client@fsf4432.service openvpn-client@fsf4433.service
+Conflicts=openvpn-client@fsf80.service openvpn-client@fsf802.service openvpn-client@fsf803.service openvpn-client@fsf443.service openvpn-client@fsf4432.service openvpn-client@fsf4433.service openvpn@fsf80.service openvpn@fsf802.service openvpn@fsf803.service openvpn@fsf443.service openvpn@fsf4432.service openvpn@fsf4433.service
 
 [Service]
 Type=oneshot
index 2dc237da63c3b563716d1c9616e5d07c1ebb4a63..a1c1b478a22d1ff16466bbb3a43e06c2b8088029 100755 (executable)
@@ -60,7 +60,7 @@ up() {
     fi
   fi
   e() { echo "$0: $*"; "$@"; }
-  errcatch-cleanup() { stop; }
+  err-cleanup() { stop; }
   modify
   # we leave it as is even when stopping, because we would like it to be default, but the only way
   # to change the default is for every device, and I want to avoid that, even though I wouldn't mind, others users of this script might.
index 3dd3e970cde04fb3a77618c64b6e1e748c9f88f1..6f96982c559c23c9542856f1efda1a145321966e 100755 (executable)
@@ -171,7 +171,9 @@ smarthost="$mxhost::$mxport"
 
 ## * Install packages
 # light version of exim does not have sasl auth support.
-pi exim4-daemon-heavy spamassassin spf-tools-perl openvpn dnsmasq
+pi exim4-daemon-heavy spamassassin spf-tools-perl dnsmasq openvpn
+# our nostart pi fails to avoid enabling
+sudo systemctl disable openvpn
 
 # trisquel 8 = openvpn, debian stretch = openvpn-client
 vpn_ser=openvpn-client
@@ -308,6 +310,8 @@ if [[ -e $f ]]; then
 fi
 if [[ $HOSTNAME == "$MAIL_HOST" ]]; then
     local_mx=mail.iankelling.org
+    mkdir -p /etc/letsencrypt/live/$local_mx
+    chmod 700 /etc/letsencrypt/live
     rsync_common="rsync -ogtL --chown=root:Debian-exim --chmod=640 root@li.iankelling.org:/etc/letsencrypt/live/$local_mx/"
     ${rsync_common}fullchain.pem /etc/exim4/exim.crt
     ret=$?
@@ -358,6 +362,10 @@ m systemctl enable mailcert.timer
 # * common exim4 config
 source /a/bin/bash_unpublished/source-state
 
+if [[ ! $MAIL_HOST ]]; then
+  err "\$MAIL_HOST not set"
+fi
+
 m sudo gpasswd -a iank adm #needed for reading logs
 
 
@@ -378,6 +386,13 @@ for d in /Maildir /root/Maildir; do
   m ln -sf -T /m/md/bounces $d
 done
 
+# Note, even the server needs permissions of this file right
+# if it exists, so do this up here.
+f=/p/c/filesystem/etc/exim4/passwd.client
+if [[ ! -e $f ]]; then
+  f=/p/c/machine_specific/$HOSTNAME/filesystem/etc/exim4/passwd.client
+fi
+m sudo rsync -ahhi --chown=root:Debian-exim --chmod=0640 $f /etc/exim4/
 
 # by default, only 10 days of logs are kept. increase that.
 m sed -ri 's/^(\s*rotate\s).*/\11000/' /etc/logrotate.d/exim4-base
@@ -834,11 +849,6 @@ EOF
 
     hostname -f >/etc/mailname
 
-    f=/p/c/filesystem/etc/exim4/passwd.client
-    if [[ ! -e $f ]]; then
-      f=/p/c/machine_specific/$HOSTNAME/filesystem/etc/exim4/passwd.client
-    fi
-    m sudo rsync -ahhi --chown=root:Debian-exim --chmod=0640 $f /etc/exim4/
 
     ;;&
   ## we use this host to monitor MAIL_HOST
diff --git a/pkgs b/pkgs
index 59e35eade60d0b50c290e5772021264bd826321c..55126fd1357030b54080afb3e06856c14ad0622d 100644 (file)
--- a/pkgs
+++ b/pkgs
@@ -106,7 +106,6 @@ p3=(
   goaccess
   gnat-5
   gnome-screenshot
-  gnupg-doc
   grepmail
   guvcview
   hunspell
diff --git a/sl/.iank/package-manager-abstractions b/sl/.iank/package-manager-abstractions
new file mode 120000 (symlink)
index 0000000..5e2f60f
--- /dev/null
@@ -0,0 +1 @@
+/a/bin/distro-functions/src/package-manager-abstractions
\ No newline at end of file
index 14a11f866ab3b03ea0d51eedf833e7782a38d848..eafe1044c0816c19aa7522b94445d6a3de7cec78 100644 (file)
@@ -24,7 +24,7 @@ EOF
 
 restore_new_btrbk=false
 restore_old_btrbk=false
-errcatch-cleanup() {
+err-cleanup() {
   if $restore_new_btrbk; then
     e WARNING: due to failure, btrbk.timer may need manual restoration:
     e $new_shell sudo systemctl start btrbk.timer
@@ -38,8 +38,8 @@ errcatch-cleanup() {
 pre="${0##*/}:"
 m() { printf "$pre %s\n"  "$*"; "$@"; }
 e() { printf "$pre %s\n"  "$*"; }
-err() { echo "[$(date +'%Y-%m-%d %H:%M:%S%z')]: $pre: $*" >&2; }
-mexit() { echo "exiting with status $1"; exit $1; }
+err() { echo "$pre: ERROR: $*" >&2; }
+mexit() { echo "$pre: exiting with status $1"; exit $1; }
 
 ##### begin command line parsing ########
 
@@ -58,20 +58,28 @@ done
 
 (( $# == 2 )) || usage 1
 
+if [[ ! $HOSTNAME ]]; then
+  err '$HOSTNAME is unset'
+  mexit 1
+fi
 
 case $1 in
   push)
+    old_host=$HOSTNAME
     new_host=$2
     bbk_args="-s $old_host"
     new_shell="ssh $new_host"
-    old_host=$HOSTNAME
+    new_hostname=$($new_shell hostname)
     ;;
   pull)
     old_host=$2
+    new_host=$HOSTNAME
+    new_hostname=$HOSTNAME
     bbk_args="-t $new_host"
     bbk_args="-s $old_host"
-    new_host=$HOSTNAME
     old_shell="ssh $old_host"
+    # test ssh connection
+    $old_shell :
     ;;
   *)
     err invalid first argument
@@ -79,7 +87,6 @@ case $1 in
     ;;
 esac
 
-
 source /a/bin/bash_unpublished/source-state
 
 if [[ $old_host != "$MAIL_HOST" ]]; then
@@ -92,8 +99,6 @@ if [[ ! $new_host || ! $old_host ]]; then
   mexit 1
 fi
 
-e $new_shell hostname
-new_hostname=$($new_shell hostname)
 
 ########### end initial processing, begin actually modifying things ##########