Add syncgittree.sh.
This commit is contained in:
parent
ee5b89f469
commit
a1f55572bd
2 changed files with 32 additions and 0 deletions
23
roles/batcave/files/syncgittree.sh
Executable file
23
roles/batcave/files/syncgittree.sh
Executable file
|
@ -0,0 +1,23 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [[ $UID != 0 ]]
|
||||||
|
then
|
||||||
|
echo "$0 must be run as root (sudo)"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "Updating $1 into $2 for production"
|
||||||
|
echo
|
||||||
|
|
||||||
|
src="$1"
|
||||||
|
dest="$2"
|
||||||
|
if [ -d $dest/.git ]; then
|
||||||
|
cd $dest
|
||||||
|
/usr/bin/git pull 2>&1
|
||||||
|
else
|
||||||
|
/usr/bin/git clone $src $dest 2>&1 | sed 's/^/ /'
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo
|
||||||
|
|
|
@ -74,6 +74,15 @@
|
||||||
- batcave
|
- batcave
|
||||||
- config
|
- config
|
||||||
|
|
||||||
|
|
||||||
|
# Hook to republish our bare repos for web viewing.
|
||||||
|
- name: setup syncgittree.sh script
|
||||||
|
copy: src=syncgittree.sh dest=/usr/local/bin/syncgittree.sh mode=0755
|
||||||
|
tags:
|
||||||
|
- batcave
|
||||||
|
- config
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Script used to gather encrypted security questions from fas
|
# Script used to gather encrypted security questions from fas
|
||||||
#
|
#
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue