понедельник, 30 января 2017 г.

bashrc.sh

#!/bin/bash
echo " = Добро пожаловать к управлению роутером = "
echo -en "\E[1;32;40m Физический адрес устройства, в сторону провайдера `/sbin/ifconfig|grep eth1|awk '{print $5}'`\E[1;32;40m"
echo "";
echo -en "\E[0m"
# eth0
ETH0=$(/sbin/ifconfig | grep -E -o "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)" | sed -n '1p')
# eth1
ETH1=$(/sbin/ifconfig | grep -E -o "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)" | sed -n '4p')
# wlan0
WLAN0=$(/sbin/ifconfig | grep -E -o "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)" | sed -n '9p')
# uptime
UPTIME=$(uptime | sed 's/^.............//' | sed 's/.................................$//')
# load
LOAD=$(uptime | awk '{print $8,$9,$10,$11,$12}')
# sensors
SENSORS=$(sensors | grep "Physical" | awk '{print $4}')
# df -h /
DF1=$(df -h | sed -n '2p' | awk '{ print $5}')
# df -h /var/spool/squid
DF2=$(df -h | grep "/var/spool/squid" | awk '{ print $5}')
# df -h /var/www
DF3=$(df -h | grep "/var/www/html" | awk '{ print $5}')
# df -h /var/log
DF4=$(df -h | grep "/var/log" | awk '{ print $5}')
# df -h /tmp
DF5=$(df -h | grep "/tmp" | awk '{ print $5}')
# i2p
I2P=$(systemctl status i2p.service | grep "Active:" | awk '{ print $9}')
# tor
TOR=$(systemctl status tor.service | grep "Active:" | awk '{ print $9}')
# privoxy
PRIVOXY=$(systemctl status privoxy.service | grep "Active:" | awk '{ print $9}')
# isc-dhcp-server
ISC=$(systemctl status isc-dhcp-server.service | grep "Active:" | awk '{ print $9}')
# bind9
BIND9=$(systemctl status bind9.service | grep "Active:" | awk '{ print $9}')
# hostapd
HOSTAPD=$(systemctl status hostapd.service | grep "Active:" | awk '{ print $9}')
# squid
SQUID=$(ps wup $(pgrep squid) | grep "squid-1" | awk '{ print $10 }')
# apache2
APACHE=$(systemctl status apache2.service | grep "Active:" | awk '{ print $9}')
# #  info print
echo " * * * Network * * *"
echo " internet $ETH1, LAN $ETH0, Wi-Fi $WLAN0"
echo "  - - - info minimum - - - "
echo " $SENSORS, UP $UPTIME, LOAD $LOAD"
echo " _ _ _ HDD _ _ _ "
echo " $DF1 /, $DF2 squid, $DF3 www, $DF4 log, $DF5 tmp"
echo " + + status + +"
echo " i2p      $I2P"
echo " tor      $TOR"
echo " privoxy  $PRIVOXY"
echo " isc      $ISC"
echo " bind9    $BIND9"
echo " hostapd  $HOSTAPD"
echo " squid    $SQUID Time Running"
echo " apache2  $APACHE"
echo "";
echo "  зашёл с IP - `echo ${SSH_CLIENT%% *}`"
echo "";

Комментариев нет:

Отправить комментарий

h265.sh

#!/bin/bash file="../mp4" if [ -d $file ]; then         echo "  Директория существует :-) "         for i in *.mp4; do f...