Skip to content

Evgeniy Bekhterev

IT, system administration and devops notes

  • EnglishEnglish
  • РусскийРусский
  • About
Evgeniy Bekhterev

Tag: bash

Create file if not exist with bash

Posted on 07.06.201602.09.2016 Evgeniy BekhterevLeave a commentPosted in IT

If you need your bash script to create file if it doesn`t exist:

[[ -f /path/filename ]] || touch /path/filename

Reset arp entry if client is not answering

Posted on 26.03.201608.06.2016 Evgeniy BekhterevLeave a commentPosted in IT
#!/bin/sh
clients=`arp -a | grep -v 10.254.0.1 | grep 10.254.0. | awk '{print ($2)}' | tr -d \)\(`
#echo $clients
for i in $clients
 do
 if ping -c 1 -t 1 $i | grep "0 packets received";
 then
 arp -d $i
# echo "not ok"
 else
# echo "ok"
 fi
 done

Tags

arp AWS azure backupy bash chef debian digitalocean encryption extend grafana info linux mediawiki mikrotik nginx openvpn partition pfsense proxy python squid squidguard swap tunnel windows zabbix

Recent

  • Amazon Web Services monitoing with Zabbix 04.08.2016
  • Mirkotiks configuration backup and more 25.07.2016
  • Create file if not exist with bash 07.06.2016
  • Bypass SSL Bump with Squid 14.04.2016
  • Custom url_rewrite_program for squid 02.04.2016

Contacts

evgeniy@bekhterev.me
Proudly powered by WordPress | Theme: Very Simple Start by Dessky.