You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/net-vpn/openconnect/files/openconnect.initd

29 lines
664 B

#!/sbin/openrc-run
# Copyright 2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
vpn=${RC_SVCNAME#*.}
command="/usr/sbin/openconnect"
pidfile="/run/openconnect/${vpn}.pid"
command_args="--syslog ${command_args}"
command_args_background="--background --pid-file \"${pidfile}\""
stopsig="SIGINT"
start_pre() {
checkpath -d /run/openconnect
}
start() {
if [ -n "${password}" ]; then
command_args="${command_args} --passwd-on-stdin"
default_start <<EOF
${password}
EOF
elif [ -n "${password_file}" ]; then
command_args="${command_args} --passwd-on-stdin"
default_start <"${password_file}"
else
default_start
fi
}