#!/bin/bash # Usage : parseConf $fileContent $propertyName # Retrieves the value of propertyName from fileContent # And echoes it back function parseConf() { result=$(echo "$1" | grep $2 | cut -f2 -d'=') echo $result } if [ $EUID -ne 0 ]; then echo "This script can only be run as root" exit -1 fi if [ "$1" = "--help" ] || [ "$1" = "-h" ]; then cat <> $confFile [Peer] PublicKey = $peerPubKey AllowedIPs = $peerAddress/32 EOF cat <