Add 'yq/ha_faking_secrets.sh'
This commit is contained in:
parent
f121bfa66b
commit
13f22fef94
39
yq/ha_faking_secrets.sh
Normal file
39
yq/ha_faking_secrets.sh
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
###################################
|
||||||
|
############ by Sthope ############
|
||||||
|
###################################
|
||||||
|
|
||||||
|
## nano ~/.bashrc
|
||||||
|
## and add this to the end of the file: export PATH=$PATH:~/bin
|
||||||
|
## sudo chmod +x ~/bin/*;su -l $USER
|
||||||
|
|
||||||
|
#### USAGE
|
||||||
|
# cd into Home Assistant folder and run: ha_faking_secrets
|
||||||
|
# Add secrets.yaml to your .gitignore file
|
||||||
|
|
||||||
|
### fake passwords
|
||||||
|
yq eval '.[] = "fake_password"' secrets.yaml > fake_pwds.yaml
|
||||||
|
|
||||||
|
### fake ips
|
||||||
|
yq eval '(.[] | select(. == "*.*.*.*")) |= "127.0.0.1"' secrets.yaml > fake_ips.yaml
|
||||||
|
|
||||||
|
### merging all into one
|
||||||
|
yq eval-all 'select(fi == 0) * select(filename == "fake_ips.yaml")' fake_pwds.yaml fake_ips.yaml > fake_secrets.yaml
|
||||||
|
|
||||||
|
### clean up..
|
||||||
|
rm fake_pwds.yaml fake_ips.yaml
|
||||||
|
|
||||||
|
### Git Push
|
||||||
|
git add .
|
||||||
|
|
||||||
|
echo 'Commit msg:'
|
||||||
|
read commitMessage
|
||||||
|
|
||||||
|
git commit -m "$commitMessage"
|
||||||
|
|
||||||
|
echo 'Branch name:'
|
||||||
|
read branch
|
||||||
|
|
||||||
|
git push origin $branch
|
||||||
|
|
||||||
|
read
|
Loading…
x
Reference in New Issue
Block a user