1
0
mirror of https://github.com/TheLocehiliosan/yadm synced 2026-03-02 03:49:29 +00:00

Improve portability of hostname (#23)

This commit is contained in:
Tim Byrne
2016-09-09 16:32:35 -05:00
parent 0a5741df8f
commit fd77d024dd

3
yadm
View File

@@ -104,7 +104,8 @@ function alt() {
#; regex for matching "<file>##SYSTEM.HOSTNAME.USER"
match_system=$(uname -s)
match_host=$(hostname -s)
match_host=$(hostname)
match_host=${match_host%%.*} #; trim any domain from hostname
match_user=$(id -u -n)
match="^(.+)##($match_system|$match_system.$match_host|$match_system.$match_host.$match_user|())$"