24 regels
424 B
Bash
Executable File
24 regels
424 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
DIR=$(dirname "$(readlink -f "$0")")
|
|
|
|
SECRETS_FILE="$DIR/../secrets.yaml"
|
|
SKEL_FILE="$SECRETS_FILE.skel"
|
|
|
|
if [ ! -f $SECRETS_FILE ]; then
|
|
echo "File missing: \"$SECRETS_FILE\""
|
|
exit 1
|
|
fi
|
|
|
|
touch $SKEL_FILE
|
|
echo "" > $SKEL_FILE
|
|
|
|
while read LINE; do
|
|
# do nothing with empty lines
|
|
if [[ $LINE = *:* ]]; then
|
|
LINE="${LINE%%:*}: "
|
|
fi
|
|
|
|
echo "$LINE" >> $SKEL_FILE
|
|
done < $SECRETS_FILE
|