Skip to content

Instantly share code, notes, and snippets.

@aenniw
aenniw / ocserv-dns.sh
Last active May 9, 2022 08:23
Automatically set hostname for OpenConnects VPN clients on OpenWRT
#!/bin/sh
# Set fields in /etc/ocsercv/ocserv.conf.template as below
#
# connect-script = /path/to/vpn-hostnames.sh
# disconnect-script = /path/to/vpn-hostnames.sh
# Set field in /etc/config/dhcp as below
#
# config dnsmasq
@aenniw
aenniw / netlink-reset.html
Created June 2, 2017 13:28
Netlink-D300 password reset
#!/usr/bin/env bash
DIR_NAMES=( "www.domain1.org" "www.domain1.org" );
cd ${1:-./}
for DIR_NAME in "${DIR_NAMES[@]}"; do
echo ok
DIR_ID=`gdrive list -m 500 -q "sharedWithMe = true" | grep -i ${DIR_NAME} | awk '{ print $1 }'`
gdrive download --recursive --force ${DIR_ID}
done