From 1b7df5050d259bcc11dd457f0e141efbc5758a34 Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Tue, 25 Aug 2015 14:14:40 +0000 Subject: [PATCH] Update test if server --- shells/zshrc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/shells/zshrc b/shells/zshrc index 43ed496..e46793f 100644 --- a/shells/zshrc +++ b/shells/zshrc @@ -62,7 +62,16 @@ if test -f /etc/gentoo-release; then echo "args: $*" sudo zsh -c "emerge --autounmask-write -av $*" } - alias update='cd /usr/portage&&sudo zsh -c "git up&&echo Done pulling&&eix-update&&echo Done with eix";\cd ->/dev/null' + function update(){ + # If this is a server computer + if [ "$(hostname|cut -b1)" = "S" ] ; then + echo "You're a server. Exiting" + exit + fi + cd /usr/portage >/dev/null + sudo zsh -c "git up&&echo Done pulling&&eix-update&&echo Done with eix" + cd ->/dev/null + } alias upgrade='sudo emerge --update --newuse --with-bdeps=y --deep --verbose -t -a --keep-going=y @world' elif test -f /etc/lsb-release; then # Ubuntu