24 行
424 B
Bash
24 行
424 B
Bash
|
#!/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
|