]> ruderich.org/simon Gitweb - config/dotfiles.git/commitdiff
use set -eu
authorSimon Ruderich <simon@ruderich.org>
Sat, 21 Jun 2014 12:35:22 +0000 (14:35 +0200)
committerSimon Ruderich <simon@ruderich.org>
Sat, 21 Jun 2014 12:35:22 +0000 (14:35 +0200)
Also correct check if $SSH_CONNECTION is set.

setup.sh

index 08efb21e3da725828b957307d14bc633ded08f9b..ee5fed1e61feeac9ba9c0ec5b734b7a71039c939 100755 (executable)
--- a/setup.sh
+++ b/setup.sh
@@ -18,7 +18,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 
-set -e
+set -eu
 
 . ../lib.sh
 
@@ -132,7 +132,7 @@ if terminal_available screen-256color; then
         echo 'screenrc: running on virtual terminal, disabling 256 colors'
     # Called through SSH connection, assume the local system supports 256
     # colors.
-    elif test -n "$SSH_CONNECTION"; then
+    elif test -n "${SSH_CONNECTION:+set}"; then
         use_256colors=1
     # We have rxvt-unicode installed, check if it supports 256 colors.
     elif installed urxvt; then