mirror of
https://github.com/TheLocehiliosan/yadm
synced 2024-10-27 20:34:27 +00:00
Improve portability of hostname
(#23)
This commit is contained in:
parent
0a5741df8f
commit
fd77d024dd
3
yadm
3
yadm
@ -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|())$"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user