sh.zio.notify: fix regex incorrect matching
parent
bfdd064e34
commit
5b446422c0
|
@ -14,7 +14,7 @@ function get_host_emoji() {
|
|||
hostname="$1"
|
||||
hostname_length="${#hostname}"
|
||||
|
||||
if [[ "$hostname" =~ ([a-z]{2}[0-9]{2,3}) ]]; then
|
||||
if [[ "$hostname" =~ (^| )([a-z]{2}[0-9]{2,3})($| ) ]]; then
|
||||
case "${hostname:0:2}" in
|
||||
"de") echo "🇩🇪" ;;
|
||||
"fi") echo "🇫🇮" ;;
|
||||
|
@ -23,7 +23,7 @@ function get_host_emoji() {
|
|||
"nl") echo "🇳🇱" ;;
|
||||
*) echo "❔" ;;
|
||||
esac
|
||||
elif [[ "$hostname" =~ ([a-z]{3}[0-9]{3}) ]]; then
|
||||
elif [[ "$hostname" =~ (^| )([a-z]{3}[0-9]{3})($| ) ]]; then
|
||||
echo "☁️"
|
||||
else
|
||||
echo "🖥️"
|
||||
|
|
Loading…
Reference in New Issue