From e3cc4c31bd41b5a2d4b3d5f4e1ecc27b541540c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Sun, 22 Apr 2018 15:27:34 +0200 Subject: Add a way to lock puppet --- modules/base_installation/files/scripts/puppet_lock | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 modules/base_installation/files/scripts/puppet_lock (limited to 'modules/base_installation/files/scripts/puppet_lock') diff --git a/modules/base_installation/files/scripts/puppet_lock b/modules/base_installation/files/scripts/puppet_lock new file mode 100644 index 0000000..cf5c429 --- /dev/null +++ b/modules/base_installation/files/scripts/puppet_lock @@ -0,0 +1,16 @@ +#!/bin/bash + +lockfile=/var/run/puppet-apply.lock +path=`dirname $0` +path=`cd $path/..; pwd` + +if [ $(id -u) -gt 0 ]; then + echo "You must be root to run this script." >&2 + exit 2 +fi + +if [ "$1" = "off" ]; then + rm -f "$lockfile" +else + touch "$lockfile" +fi -- cgit v1.2.3