Check if client config exists

This commit is contained in:
Paul-Christian Volkmer 2022-12-11 16:28:14 +01:00
parent 9afa126178
commit 214f830065
2 changed files with 10 additions and 0 deletions

View File

@ -1,5 +1,10 @@
#!/bin/bash
if [ ! -f "$DEVICE-client_$1.conf" ]; then
echo "No client $1"
exit 1
fi
CONFIG=$(cat "$DEVICE.conf" | sed "/^\# Client $1/{N;N;N;N;d}")
echo "$CONFIG" > "$DEVICE.conf"

View File

@ -1,5 +1,10 @@
#!/bin/bash
if [ ! -f "$DEVICE-client_$1.conf" ]; then
echo "No client $1"
exit 1
fi
cat "$DEVICE-client_$1.conf"
echo