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