User:Jtagcat/Automatically retrieve phone's IP to SSH in to with syncthing

''Content moved by ollieparanoid from SSH to user's page since this is more of a personal setup description than something that can be used generically. Note that avahi may be used for similar purpose.''

Automatically retrieve phone's IP to SSH in to
WARN: Not battle-tested, worst case it doesn't magically work. ifdata returns only the first address (usually the most local, ipv4 first).