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:
3
yadm
3
yadm
@@ -104,7 +104,8 @@ function alt() {
|
|||||||
|
|
||||||
#; regex for matching "<file>##SYSTEM.HOSTNAME.USER"
|
#; regex for matching "<file>##SYSTEM.HOSTNAME.USER"
|
||||||
match_system=$(uname -s)
|
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_user=$(id -u -n)
|
||||||
match="^(.+)##($match_system|$match_system.$match_host|$match_system.$match_host.$match_user|())$"
|
match="^(.+)##($match_system|$match_system.$match_host|$match_system.$match_host.$match_user|())$"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user