Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
configfile="/opt/zimbra/conf/nginx/templates/nginx.conf.web.https.default.template"
[ -e /opt/zimbra/conf/nginx/external_ip.txt ] && ipaddress="$(cat /opt/zimbra/conf/nginx/external_ip.txt)" || ipaddress="$(curl -fsSL ifconfig.co)"
crtfile="/opt/zimbra/ssl/zimbra/server/server.crt"
keyfile="/opt/zimbra/ssl/zimbra/server/server.key"
pattern="server(\n|\s)?{\n\s+listen\s*443\sssl\shttp2;\n\s+server_name\s+$ipaddress;\n\s+ssl_certificate\s+${crtfile//\//\\/};\n\s+ssl_certificate_key\s+${keyfile//\//\\/};\n\s+location\s+\/\s+\{\n\s*return 200 \'Hello World!\';\n\s+\}\n}"
block="
#!/bin/bash
FILE='/opt/zimbra/conf/nginx/templates/nginx.conf.web.https.default.template'
if [[ ! -f "/etc/nginx-php-fpm.conf" ]]
then
echo "Zimbra sunucusunda Z-Push kurulu değil."
exit
fi
# HTTPS Proxy Default Configuration
${web.strict.servername}# Strict servername enforcing block
${web.strict.servername}# Enabled/disabled through the 'zimbraReverseProxyStrictServerName' configuration item
${web.strict.servername}# The $\{listen.:addresses\} is NOT demarcated with web.strict.servername on purpose.
${web.strict.servername}server {
${web.strict.servername} ${core.ipboth.enabled}listen [::]:${web.https.port} default_server ipv6only=off;
${web.strict.servername} ${core.ipv4only.enabled}listen ${web.https.port} default_server;
${web.strict.servername} ${core.ipv6only.enabled}listen [::]:${web.https.port} default_server;
${web.strict.servername} server_name _;
###########################################################################
# Set some Variable
echo "Set some Variables needed for install time"
brand=FreePBXDistro
version=5.211.65-1
###########################################################################
echo
echo "Moving to Next Step"
echo
###########################################################################
@vedatkamer
vedatkamer / caddy.sh
Created September 29, 2017 13:56 — forked from Jamesits/caddy.sh
Install Caddy Server on Ubuntu with Systemd.
# Run as root please
apt install curl
curl -L https://getcaddy.com | bash -s http.awslambda,http.cgi,http.cors,http.expires,http.filemanager,http.filter,http.git,http.hugo,http.ipfilter,http.jwt,http.mailout,http.minify,http.prometheus,http.proxyprotocol,http.ratelimit,http.realip,http.upload,dns,net,hook.service
chown root:root /usr/local/bin/caddy
chmod 755 /usr/local/bin/caddy
setcap 'cap_net_bind_service=+ep' /usr/local/bin/caddy
mkdir -p /etc/caddy
chown -R root:www-data /etc/caddy
mkdir -p /etc/ssl/caddy
@vedatkamer
vedatkamer / openvpn_check.sh
Last active July 16, 2017 21:35
OpenVPN Check Script for CentOS 5/6 and Debian 5/6/7
#!/bin/bash
#
# check openvpn
#
# config
DEVICE="tun0"
STATS_FILE="/proc/net/dev"
INTERFACES="$(cat ${STATS_FILE})"
OPENVPN_INIT="/etc/init.d/openvpn"
### Keybase proof
I hereby claim:
* I am vedatkamer on github.
* I am vedatkamer (https://keybase.io/vedatkamer) on keybase.
* I have a public key whose fingerprint is F447 0C53 0BE4 D265 A167 E548 69F0 6616 3A99 0514
To claim this, I am signing this object: