Skip to content

Instantly share code, notes, and snippets.

@nonamed01
nonamed01 / fuckForticlient.sh
Last active March 26, 2024 13:04
fuckForticlient, a command-line client to connect to SAML fortivpn servers by using openfortivpn and the --cookie-in-stdin parameter
#!/bin/bash
# Uncomment the following line to debug the script:
#set -x
#####################################################################################
# fuckForticlient.sh
#
# Script to authenticate against Fortinet SAML servers using Firefox and
# openfortivpn. This replaces Forticlient for GNU/Linux completely.
# Because openfortivpn does not support SAML login (yet), this script uses Firefox
# to authenticate, grabs SVPNCOOKIE and then calls openfortivpn to setup
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
isexpr(x::Expr, ts...) = x.head in ts
isexpr{T}(x::T, ts...) = T in ts
macro with(exprs...)
exprs = collect(exprs)
target = nothing
if length(exprs) > 1 && !isexpr(exprs[end], :(::))
target = esc(exprs[end])
pop!(exprs)
end