3 Commits 7f3da54198 ... 54c18a8141

Autore SHA1 Messaggio Data
  Anonymous 54c18a8141 autodetects ifconfig/ip 1 settimana fa
  Anonymous 0f186bf2eb Merge https://notabug.org/themusicgod1/tools 1 settimana fa
  Anonymous 8a916bae9e wip wicksell nov 11 2024 1 settimana fa
4 ha cambiato i file con 17 aggiunte e 11 eliminazioni
  1. 0 0
      git-gimme-a-patch
  2. 1 1
      is_tor_working
  3. 15 10
      scan-network.sh
  4. 1 0
      screenrc

+ 0 - 0
git-gimme-a-patch


+ 1 - 1
is_tor_working

@@ -1,4 +1,4 @@
 #!/bin/bash
 # GPLv3 or later see COPYING.GPL
-torify curl -s https://check.torproject.org/api/ip
 
+curl --socks5-hostname localhost:9050 https://check.torproject.org/api/ip

+ 15 - 10
scan-network.sh

@@ -1,5 +1,4 @@
 #!/bin/bash
-
 # GPLv3 or later 2017 Jeff Cliff
 #
 # See COPYING.GPL
@@ -7,19 +6,25 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
-network=`/sbin/ifconfig  | grep inet | grep -iv inet6  | grep -iv 127.0.0.1 | awk -F' ' '{print $2}' | awk -F'.' '{print $1 "." $2 "." $3 ""}' | sed -s "s/addr://g"`
-echo $network
-for y in $network; do 
+DOES_IFCONFIG_EXIST=`which ifconfig`
+if [[ -z $DOES_IFCONFIG_EXIST ]]; then
+IPCOMMAND="ip address"
+else
+IPCOMMAND="ifconfig"
+fi
+echo "IPCOMMAND" $IPCOMMAND 
+
+# sometimes ifconfig is available, this is where to find/change it if it is. maybe we should autodetect if it does
 
-for x in `seq 255` ; 
+network=`$IPCOMMAND | grep inet | grep -iv inet6  | grep -iv 127.0.0.1 | awk -F' ' '{print $2}' | awk -F'.' '{print $1 "." $2 "." $3 ""}' | sed -s "s/addr://g"`
+echo $network
+for y in $network; do
+for x in `seq 255` ;
 do
 #echo "network:" $y
-#echo "x:" $x 
+#echo "x:" $x
 #echo "network.x:" $y.$x
-
 #echo ping -c 1 $y.$x
-    
-ping -c 1 $y.$x | grep -i 'ttl' |  grep -iv 'Unreachable' & 
+ping -c 1 $y.$x | grep -i 'ttl' |  grep -iv 'Unreachable' &
 done
-
 echo $y ; done

+ 1 - 0
screenrc

@@ -0,0 +1 @@
+defscrollback 1000000