Skip to content

Commit

Permalink
Cron and syntax fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jtrefke committed Apr 5, 2020
1 parent f6d8989 commit 73a836d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
4 changes: 3 additions & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/bionic64"
config.vm.network "private_network", ip: "10.0.3.33"
config.vm.provider 'virtualbox' { |box| box.name = 'jitsi-meet' }
config.vm.provider 'virtualbox' do |box|
box.name = 'jitsi-meet'
end

config.vm.provision "install-jitsi", type: :shell, inline: <<-SHELL
cd /vagrant
Expand Down
14 changes: 8 additions & 6 deletions installer/install-jitsi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ main() {
log "Install dependencies..."; install_dependencies
log "Install Jitsi..."; install_jitsi
log "Setup Jitsi SIP dialin..."; install_phone_dialin
log "Install ssl certificate..."; install_ssl_certificate
log "Install SSL certificate..."; install_ssl_certificate
log "Enable Jitsi user authentication..."; enable_authentication
log "Tweaking Jitsi config..."; tweak_config

Expand Down Expand Up @@ -251,7 +251,7 @@ invoke_hook() {

is_command_present curl || os_pkg_install curl
curl -sL "$(hook_content "${name}")"
log "Waiting for ${HOOKS_WAIT_TIME} seconds..."
log "Waiting for ${HOOKS_WAIT_TIME:-} seconds..."
sleep ${HOOKS_WAIT_TIME:-0}
}

Expand All @@ -266,13 +266,15 @@ persist_hook() {
local event="${2}"

is_hook_provided "${name}" || return 0
{
crontab -l 2>/dev/null; echo "@${event} $(command -v curl) -sL '$(hook_content "${name}")'"
} | crontab -
(
crontab -l 2>/dev/null || true
echo "@${event} $(command -v curl) -sL '$(hook_content "${name}")'"
) | crontab -
}

get_fully_qualified_hostname() {
local ec2_hostname; ec2_hostname=$(curl --connect-timeout 1 -s http://169.254.169.254/2019-10-01/meta-data/public-hostname || true)
local ec2_hostname
ec2_hostname=$(curl --connect-timeout 1 -s http://169.254.169.254/2019-10-01/meta-data/public-hostname || true)
ec2_hostname=${ec2_hostname:-$(hostname)}

echo "${FULLY_QUALIFIED_HOSTNAME:-${ec2_hostname}}"
Expand Down

0 comments on commit 73a836d

Please sign in to comment.