Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

come resettare le impostazioni di connessione linux

  #!/bin/sh # program to check wifi and reset if not running IPTEST=192.168.1.1 iwconfig=/sbin/iwconfig rfkill=/usr/sbin/rfkill DEVICE=`$iwconfig | egrep 802 | awk ' {print $1}'` if ping -c 1 $IPTEST >/dev/null 2>&1 ; then #echo $IPTEST ok exit 0 else # Failed, try to reset wifi - sometimes works ok ( date echo "Apagando wifi...." nmcli nm wifi off sleep 3 echo Iniciando wifi.... nmcli nm wifi on sleep 10 if ping -c 1 $IPTEST >/dev/null 2>&1 ; then #echo $IPTEST ok exit 0 else # try another way echo "Apagando wifi $iwconfig ...." $iwconfig $iwconfig $DEVICE txpower off sleep 3 echo Iniciando wifi.... $iwconfig $DEVICE txpower auto fi sleep 10 if ping -c 1 $IPTEST >/dev/null 2>&1 ; then #echo $IPTEST ok exit 0 else # try another way echo "Apagando wifi $rfkill ...." $rfkill list $rfkill block wifi sleep 3 echo Iniciando wifi.... $rfkill unblock wifi fi #echo Cerrar esta ventana cuando sale el estado #sleep 3 #iftop -i $DEVICE ) >> $HOME/wificheck.log 2>&1 fi exit 0 
Comment

PREVIOUS NEXT
Code Example
Shell :: Freeze your process list across server restart 
Shell :: git deploy to cpane in .cpanel.yml 
Shell :: how to install numpy for aws sam local 
Shell :: Another linux info 
Shell :: install kivyMD from git 
Shell :: team viewer centos 
Shell :: make a batch file that accepts pipe input 
Shell :: grep global configuration 
Shell :: calcul md5 fichier linux 
Shell :: add mongodb path to bashrc 
Shell :: whats up with docker compose and orphan containers 
Shell :: last_ack 
Shell :: wireshark export list of ip addresses 
Shell :: how to perform an action for each line in bash 
Shell :: can i create a branch inside of another branch in GIT 
Shell :: how to rollback to 20h2 
Shell :: remove deb repository 
Shell :: uninstall laptop mode tools elementary os 
Shell :: Running MacOS on Windows 10 with WSL2 
Shell :: shell how to replace single quote 
Shell :: are pip packages safe for linux 
Shell :: bash set+x hide 
Shell :: linux directory structure 
Shell :: raspberrypi install xserver 
Shell :: powershell delete scoop 
Shell :: how to update all repositories in manjaro using terminal 
Shell :: jq yq for html 
Shell :: npm run watch not updating 
Shell :: Err:6 https://apt.kubernetes.io kubernetes-xenial Release 
Shell :: enable podman behavior as docker 
ADD CONTENT
Topic
Content
Source link
Name
8+6 =