mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-05 11:12:03 +00:00
Add cleanup function to make the build.sh more robust
This commit is contained in:
@@ -17,9 +17,15 @@
|
||||
# Download the etcd, flannel, and K8s binaries automatically
|
||||
# Run as root only
|
||||
|
||||
# author @resouer
|
||||
# author @resouer @WIZARD-CXY
|
||||
set -e
|
||||
|
||||
function cleanup {
|
||||
# cleanup work
|
||||
rm -rf flannel kubernetes* etcd* binaries
|
||||
}
|
||||
trap cleanup SIGHUP SIGINT SIGTERM
|
||||
|
||||
# check root
|
||||
if [ "$(id -u)" != "0" ]; then
|
||||
echo >&2 "Please run as root"
|
||||
|
Reference in New Issue
Block a user