mirror of
https://github.com/Llewellynvdm/Tomb.git
synced 2024-11-10 23:20:57 +00:00
support reading hostname from file
also tolerate not finding the hostname (fill localhost) address #428
This commit is contained in:
parent
41a7d92ce5
commit
7ef9499160
8
tomb
8
tomb
@ -2389,7 +2389,13 @@ mount_tomb() {
|
|||||||
_update_control_file "${tombmount}/.uid" $_UID
|
_update_control_file "${tombmount}/.uid" $_UID
|
||||||
_update_control_file "${tombmount}/.tty" $_TTY
|
_update_control_file "${tombmount}/.tty" $_TTY
|
||||||
# also the hostname
|
# also the hostname
|
||||||
_update_control_file "${tombmount}/.host" `hostname`
|
if command -v hostname >/dev/null; then
|
||||||
|
_update_control_file "${tombmount}/.host" `hostname`
|
||||||
|
elif [[ -r /etc/hostname ]]; then
|
||||||
|
_update_control_file "${tombmount}/.host" $(_cat /etc/hostname)
|
||||||
|
else
|
||||||
|
_update_control_file "${tombmount}/.host" localhost
|
||||||
|
fi
|
||||||
# and the "last time opened" information
|
# and the "last time opened" information
|
||||||
# in minutes since 1970, this is printed at next open
|
# in minutes since 1970, this is printed at next open
|
||||||
_update_control_file "${tombmount}/.last" `date +%s`
|
_update_control_file "${tombmount}/.last" `date +%s`
|
||||||
|
Loading…
Reference in New Issue
Block a user