network: use template instead of shell commands
common: use template for hostname