Skip to content

Commit 5a910f5

Browse files
committed
Add check when rerunning same container
1 parent ab9c64b commit 5a910f5

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

test/custom_init.sh

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,11 @@ set -e
22
sudo microdnf install git
33
sudo -u splunk mkdir -p /opt/splunk/vcs/{git_tmp_backup,git_tmp_restore}
44
sudo -u splunk mkdir -p /opt/splunk/vcs/backup.git
5-
echo "dirs"
65
sudo -u splunk sh -c "cd /opt/splunk/vcs/backup.git && git init --bare --shared"
7-
echo "init"
6+
if [ ! -d "/opt/splunk/vcs/backup.git" ]; then
87
sudo -u splunk sh -c "cd /opt/splunk/vcs/ && git clone backup.git"
98
sudo -u splunk sh -c "git config --global user.email '[email protected]'"
109
sudo -u splunk sh -c "git config --global user.name 'BackupUser'"
11-
echo "clone"
1210
sudo -u splunk sh -c 'cd /opt/splunk/vcs/backup && touch test && git add test && git commit -a -m "init" && git push'
13-
echo "file"
14-
11+
fi
1512
/usr/sbin/entrypoint.sh start

0 commit comments

Comments
 (0)