#!/bin/sh # ===================================================================== # Projet : DARKWALL # Fichier : bin/ifdhcpexit.firewall # Auteur : Nicolas "DarkHack" Chapuis (c) 2026 # ================== DARKHACK ================== # [ darkweb.fr - system online ] # Powered by Perplexity, your AI assistant # https://www.perplexity.ai # ============================================== # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ===================================================================== # loop over the 4 possible prefixes: (empty), cur_, new_, old_ jsonParamDhcp="" first=1 for prefix in '' 'cur_' 'new_' 'old_'; do # loop over the DHCP variables passed to dhclient-script for basevar in reason interface medium alias_ip_address \ ip_address host_name network_number subnet_mask \ broadcast_address routers static_routes \ rfc3442_classless_static_routes \ domain_name domain_search domain_name_servers \ netbios_name_servers netbios_scope \ ntp_servers \ ip6_address ip6_prefix ip6_prefixlen \ dhcp6_domain_search dhcp6_name_servers do var="${prefix}${basevar}" content="" eval "content=\"\$$var\"" # show only variables with values set if [ -n "${content}" ]; then if [ "$first" -eq 1 ];then first=0 jsonParamDhcp="\"${var}\":\"${content}\"" else jsonParamDhcp="${jsonParamDhcp},\"${var}\":\"${content}\"" fi fi done done jsonParamDhcp="{${jsonParamDhcp}}" sh /etc/darkwall/bin/tryPipeMessage dhcp-exit "$( echo "${jsonParamDhcp}" | base64 | tr -d '[:space:]')" & [ -f /etc/darkwall/data/dhcp-nudge.sh ] && sh /etc/darkwall/data/dhcp-nudge.sh > /tmp/dhcp-nudge.log &