mirror of https://framagit.org/kyodev/kyopages.git
0.7.3
This commit is contained in:
parent
3152e7f9f6
commit
dd4ccd127b
|
@ -19,7 +19,7 @@ chmod +x getIp
|
|||
getIp 0.7.0
|
||||
|
||||
----------------------------------------------------------------------
|
||||
./getIo : exécution normale
|
||||
./getIp : exécution normale
|
||||
getIp : exécution normale si script installé dans le système
|
||||
|
||||
ce script requiert une des commandes suivantes pour déterminer l'ip publique :
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
version=0.7.2
|
||||
version=0.7.3
|
||||
date="18/08/2017"
|
||||
projet="simpledeb"
|
||||
contact="IRC freenode ##sdeb ou https://framagit.org/kyodev/kyopages/issues"
|
||||
|
@ -81,7 +81,7 @@ fscript_cronAnacron(){ # v18/08/2017
|
|||
# table anacron
|
||||
echo "7 01 $script nice /opt/bin/$script --upgrade" > "$fileAnacron"
|
||||
## dev: anacron journalier:
|
||||
[ "$LOGNAME" == "$lognameDev" ] && echo "1 01 $script test nice /opt/bin/$script --upgrade 1>/dev/null" >> "$fileAnacron"
|
||||
[ "$user_" == "$lognameDev" ] && echo "1 01 $script test nice /opt/bin/$script --upgrade 1>/dev/null" >> "$fileAnacron"
|
||||
# création spool anacron utilisateur
|
||||
mkdir -p "$dirSpool"
|
||||
chown -R "$user_": "$dirAnacron" "$dirSpool"
|
||||
|
@ -198,6 +198,7 @@ EOF
|
|||
}
|
||||
|
||||
get_ip() { # $ip_local, $gateway, $gateway_type, $gateway_one, $ip_local, $ip_local_type, $ifname, $ifname_type
|
||||
[ -z "$(which ip)" ] && return 1
|
||||
ip_local="$(sed '/lo.*inet/d; /inet6.*scope global/d' <<< "$(ip -o a)" | awk '{print $4,"(",$2,")"}')"
|
||||
ip_local_type="$(sed -E 's/(^.*wl.*)/\1 (wifi)/;s/(^.*en.*|^.*eth.*)/\1 (ethernet)/' <<< $ip_local)"
|
||||
gateway="$(LC_ALL=C ip -4 route | awk '/default via/ {print $3,"(",$5,")"}'; LC_ALL=C ip -6 route | awk '/default via/ {print $3,"(",$5,")"}')"
|
||||
|
@ -207,7 +208,6 @@ get_ip() { # $ip_local, $gateway, $gateway_type, $gateway_one, $ip_local, $ip_lo
|
|||
ifname_type="$(sed -E 's/(^wl.*)/\1 (wifi)/;s/(^en.*|^eth.*)/\1 (ethernet)/' <<< $ifname)"
|
||||
}
|
||||
|
||||
|
||||
get_ip_public(){ # $1=IPv4|IPv6, assigne $ip_public
|
||||
|
||||
list_ip4(){
|
||||
|
@ -327,7 +327,7 @@ for i in "$options"; do
|
|||
get_ip_public "IPv6"
|
||||
echo "$ip_public" ;; # affiche ip v6 public
|
||||
--local | "" )
|
||||
get_ip
|
||||
get_ip || f__error "iproute2 doit être installé" "il remplace net-tools qui n'est plus développé"
|
||||
echo -e "\tip locale(s):\n$ip_local_type"
|
||||
echo -e "\tpasserelle(s):\n$gateway_type" ;; # affiche ip locales
|
||||
--version | -v )
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
# changelog getIp
|
||||
|
||||
## 0.7.2 18/08/2017
|
||||
|
||||
|
||||
## 0.7.3 18/08/2017
|
||||
|
||||
* maj fscript_cronAnacron pour dev
|
||||
* révision ip locales
|
||||
* protection absence iproute
|
||||
|
||||
## 0.7.1 17/08/2017
|
||||
|
||||
|
|
Loading…
Reference in New Issue