]> git.immae.eu Git - perso/Immae/Projets/Puppet.git/blob - modules/base_installation/files/scripts/puppet_lock
Add a way to lock puppet
[perso/Immae/Projets/Puppet.git] / modules / base_installation / files / scripts / puppet_lock
1 #!/bin/bash
2
3 lockfile=/var/run/puppet-apply.lock
4 path=`dirname $0`
5 path=`cd $path/..; pwd`
6
7 if [ $(id -u) -gt 0 ]; then
8 echo "You must be root to run this script." >&2
9 exit 2
10 fi
11
12 if [ "$1" = "off" ]; then
13 rm -f "$lockfile"
14 else
15 touch "$lockfile"
16 fi