summaryrefslogtreecommitdiffstats
path: root/ship
diff options
context:
space:
mode:
authormakefu <root@pigstarter.de>2013-12-17 09:29:24 +0100
committermakefu <root@pigstarter.de>2013-12-17 09:29:24 +0100
commite8a3666d702fc099baba8b0b41ff414a8571fd55 (patch)
tree2f72626742ee8213a5fcf57803818b7aa64e5cc0 /ship
parentf5c8830887fc238ed1d1075e1459dadc44f5ad4d (diff)
parentabf03f260a3d4b3b1b62c98ede3014b724658e1c (diff)
Merge branch 'master' of https://github.com/krebscode/painload
Diffstat (limited to 'ship')
-rwxr-xr-xship/build16
-rw-r--r--ship/lib/network10
2 files changed, 19 insertions, 7 deletions
diff --git a/ship/build b/ship/build
index 5863e325..f7dcf3c2 100755
--- a/ship/build
+++ b/ship/build
@@ -40,12 +40,22 @@ EOF
fi
}
+## usage: #@strict -> build_strict_mode \1
+build_strict_mode() { cat<<EOF
+$1a\\
+set -euf\\
+set -o posix || :
+EOF
+}
+
## usage: #@info -> build_info \1
-build_info() { cat<<EOF
+build_info() {
+ gitinfo=$(git describe --always --dirty --abbrev=0 2>/dev/null || :)
+cat<<EOF
$1a\\
# this file was generated by //ship/build\\
# build date: $(date -u --rfc-3339=s)\\
-# git describe: $(git describe --always --dirty --abbrev=0)
+# git describe: ${gitinfo:-not under version control}
EOF
}
@@ -177,6 +187,8 @@ buildcache_add() {
echo "$1" >> "$buildcache"
}
+
+
###
### main invocation
###
diff --git a/ship/lib/network b/ship/lib/network
index 29eefdbe..90d7ec4f 100644
--- a/ship/lib/network
+++ b/ship/lib/network
@@ -10,7 +10,7 @@ which_get_loader(){
echo "wget -O-"
fi
else
- echo "curl"
+ echo "curl -s"
fi
return 0
}
@@ -21,19 +21,19 @@ which_head_loader(){
warn "Please install curl or wget"
return 1
else
- echo "wget -O- --spider"
+ echo "wget -O- --spider -S -q"
fi
else
- echo "curl -I"
+ echo "curl -I -s"
fi
return 0
}
http_get(){
- eval "$(which_get_loader)" "${1?please provide url}"
+ eval "$(which_get_loader)" "${1?please provide url}" 2>&1
}
http_head(){
- eval "$(which_head_loader)" "${1?please provide url}"
+ eval "$(which_head_loader)" "${1?please provide url}" 2>&1
}
which_telnet(){