#!/bin/sh usage () { echo "Usage: $(basename $0) {host}" } termwrapper () { title="$title $titleopt" echo $@ echo xsh --title "Host update" --host $HOST $@ && touch /etc/local-LOCAL/machines/$args xsh --title "Host update" --host $HOST $@ && touch /etc/local-LOCAL/machines/$args } args='' argc=0 while [ $# -gt 0 ]; do case $1 in -*) usage; exit 1;; *) args="$args $1"; argc=$(($argc+1));; esac shift done set -- $args if [ $argc -ne 1 ]; then usage; exit 1; fi HOST=$1 termwrapper "apt-get update; apt-get upgrade"