Skip to content

Instantly share code, notes, and snippets.

@pylover
Last active July 29, 2025 08:51
Show Gist options
  • Save pylover/69f37287ec91aee39071fb1acf62348e to your computer and use it in GitHub Desktop.
Save pylover/69f37287ec91aee39071fb1acf62348e to your computer and use it in GitHub Desktop.
‌Kerio control automatic installation on Ubuntu 24.04
#! /usr/bin/env bash
# license: Freeware
# author: github.com/pylover
#
# to change the credentials, edit /etc/kerio-kvc.conf
# or
# sudo dpkg-reconfigure kerio-control-vpnclient
#
# Some users yelling about the MAC address invalidation, but I can't reproduce
# it. my tunnel interface MAC address is the same as the
# `/var/log/kerio-kvc/debug.log`.
#
# {info} Kerio Control VPN Client Service 9.5.0 patch 1 build 8907 started.
# {vpnCore} VPN driver opened, version = 2.1, ifIndex = 6 (0x6), MAC 3e-9a-8f-ca-7a-f9
# $ ip li
# link/ether 3e:9a:8f:ca:7a:f9
os="unknown"
ver="unknown"
# check the execution safety.
if [ -f /etc/lsb-release ]; then
. /etc/lsb-release
os=$DISTRIB_ID
ver=$DISTRIB_RELEASE
fi
if [ "${os}" != "Ubuntu" ] || [ "${ver}" != "24.04" ]; then
echo "Invalid OS and or version: ${os} v${ver}" >&2
exit 1
fi
# remember the current kernel version
kver=$(uname -r)
if ! [[ "${kver}" =~ ^6\.14.* ]]; then
echo "Invalid kernel version: ${kver}" >&2
exit 1
fi
# user confirmation
echo "OS: ${os} v${ver}"
echo "Kernel: ${kver}"
read -p "Do you want to continue installing the kerio-connect? [N/y] "
if ! [[ $REPLY =~ ^[Yy]$ ]]; then
echo "Canceled by user" >&2
exit 1
fi
read -p "Do you want to issue an apt update? [N/y] "
if [[ $REPLY =~ ^[Yy]$ ]]; then
sudo apt update
fi
# prerequisites
sudo apt install debconf openssl wget
# download
kcver="9.5.0-8907"
kcfilename="kerio-control-vpnclient-${kcver}-p1-linux-amd64.deb"
kcurl="https://cdn.kerio.com/dwn/control/control-${kcver}/${kcfilename}"
if [ ! -f ${kcfilename} ]; then
wget "${kcurl}"
fi
if [ ! -f ${kcfilename} ]; then
echo "download failed: ${kcurl}" >&2
exit 1
fi
sudo dpkg -i ${kcfilename}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment