From 642522a01d7e517ad11146c78424f5669914ef5d Mon Sep 17 00:00:00 2001 From: Anthony Axenov Date: Mon, 16 Feb 2026 17:24:42 +0800 Subject: [PATCH] frkn removed --- install/frkn | 53 ---------------------- scripts/frkn.sh | 115 ------------------------------------------------ 2 files changed, 168 deletions(-) delete mode 100755 install/frkn delete mode 100755 scripts/frkn.sh diff --git a/install/frkn b/install/frkn deleted file mode 100755 index fb100a0..0000000 --- a/install/frkn +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/env bash -##makedesc: Install Wireguard + FRKN (deprecated) -source "$( dirname $(readlink -e -- "${BASH_SOURCE}"))/../helpers.sh" || exit 255 - -# https://frkn.org/ru/installation - -title - -mkdir -p "$HOME/install/frkn" -cd "$HOME/install/frkn" - -apt_install wireguard jq - -countries=(jp nl tr at ru se) -for idx in ${!countries[@]}; do - country=${countries[idx]} - info "Downloading config for $country ($(expr $idx + 1)/${#countries[@]})" - - json=$(curl -s "https://api.frkn.org/peer?location=$country" | jq) - - iface_address=$(echo $json | jq -r .iface.address) - iface_privkey=$(echo $json | jq -r .iface.key) - iface_dns=$(echo $json | jq -r .iface.dns) - peer_pubkey=$(echo $json | jq -r .peer.pubkey) - peer_psk=$(echo $json | jq -r .peer.psk) - peer_allowed_ips=$(echo $json | jq -r .peer.allowed_ips) - peer_endpoint=$(echo $json | jq -r .peer.endpoint) - - cat << EOF > "frkn-$country.conf" -[Interface] -Address = $iface_address -DNS = $iface_dns -PrivateKey = $iface_privkey - -[Peer] -PublicKey = $peer_pubkey -PresharedKey = $peer_psk -AllowedIPs = $peer_allowed_ips -Endpoint = $peer_endpoint -PersistentKeepalive = 25 -EOF - -done - -sudo cp frkn-*.conf /etc/wireguard/ - -[ $? = 0 ] && { - echo - success "Wireguard + FRKN installed!" - wg --version - info "Use 'wg-quick (up|down) frkn-($(implode '|' ${countries[@]}))' to control connections" - info "Use 'sudo wg show' to see connection status" -} diff --git a/scripts/frkn.sh b/scripts/frkn.sh deleted file mode 100755 index d64ba9c..0000000 --- a/scripts/frkn.sh +++ /dev/null @@ -1,115 +0,0 @@ -#!/usr/bin/env bash - -function disconnect() { - echo "Disconnecting: $1" - sudo wg-quick down "$1" - sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1 - sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1 - sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=1 - echo -} - -function connect() { - echo "Connecting: frkn-$1" - sudo sysctl -w net.ipv6.conf.all.disable_ipv6=0 - sudo sysctl -w net.ipv6.conf.default.disable_ipv6=0 - sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=0 - sudo wg-quick up "frkn-$1" - echo -} - -function in_array() { - local find=$1 - shift - for e in "$@"; do - [[ "$e" == "$find" ]] && return 0 - done - return 1 -} - -function update_wg() { - sudo apt install -y wireguard jq && wg --version -} - -function update_frkn() { - local countries=(uk ru nl nl2 ch) - for idx in ${!countries[@]}; do - country=${countries[idx]} - echo "Downloading config for $country ($(expr $idx + 1)/${#countries[@]})" - - json=$(curl -s "https://api.frkn.org/peer?location=$country" | jq) - - iface_address=$(echo $json | jq -r .iface.address) - iface_privkey=$(echo $json | jq -r .iface.key) - iface_dns=$(echo $json | jq -r .iface.dns) - peer_pubkey=$(echo $json | jq -r .peer.pubkey) - peer_psk=$(echo $json | jq -r .peer.psk) - peer_allowed_ips=$(echo $json | jq -r .peer.allowed_ips) - peer_endpoint=$(echo $json | jq -r .peer.endpoint) - - cat << EOF > "./frkn-$country.conf" -[Interface] -Address = $iface_address -DNS = $iface_dns -PrivateKey = $iface_privkey - -[Peer] -PublicKey = $peer_pubkey -PresharedKey = $peer_psk -AllowedIPs = $peer_allowed_ips -Endpoint = $peer_endpoint -PersistentKeepalive = 25 -EOF - done - sudo mv -f ./frkn-*.conf /etc/wireguard/ -} - -command="$1" -countries=() -current=$(sudo wg show | head -n 1 | awk '{print $2}') - -for file in /etc/wireguard/*.conf; do - filename=${file/\/etc\/wireguard\/frkn-} - code=${filename/.conf/} - countries+=($code) -done - -correct=-1 -if [ -z "$command" ] ; then - while [ $correct -lt 0 ]; do - read -rp "Entry on of country code (${countries[*]}): " command - if in_array "$command" ${countries[@]}; then - correct=1 - else - echo "Неверный код страны!" - fi - done -fi - -case "$command" in - "update" ) - if update_wg && update_frkn; then - echo "Wireguard and FRKN updated" - else - echo "Something went wrong" - exit 1 - fi - ;; - - "down" ) - if [ -n "$current" ]; then - disconnect "$current" - fi - ;; - - "show" ) - sudo wg show - ;; - - * ) - if [ -n "$current" ]; then - disconnect "$current" - fi - connect "$command" - ;; -esac