first commit from PC
This commit is contained in:
Executable
+47
@@ -0,0 +1,47 @@
|
||||
#!/bin/bash
|
||||
|
||||
CONFIG="default_configuration.yaml"
|
||||
|
||||
FILE=$1
|
||||
|
||||
#Insert version number
|
||||
|
||||
awk '/type: arduino/{print $0 RS " version: 2.0.6";next}1' $FILE > tmp
|
||||
rm $FILE
|
||||
mv tmp $FILE
|
||||
|
||||
#remove random ota password
|
||||
|
||||
sed '20d' $FILE > tmp
|
||||
rm $FILE
|
||||
mv tmp $FILE
|
||||
|
||||
#Insert ota password
|
||||
|
||||
awk '/ota:/{print $0 RS " password: !secret ota_password";next}1' $FILE > tmp
|
||||
rm $FILE
|
||||
mv tmp $FILE
|
||||
|
||||
#remove default wifi config
|
||||
|
||||
sed '23d;24d' $FILE > tmp
|
||||
rm $FILE
|
||||
mv tmp $FILE
|
||||
|
||||
#Insert wifi Config
|
||||
|
||||
ed $FILE <<END
|
||||
22a
|
||||
$(sed -n 2,7p $CONFIG)
|
||||
.
|
||||
wq
|
||||
END
|
||||
|
||||
# Append remaining config
|
||||
|
||||
ed $FILE <<END
|
||||
36a
|
||||
$(sed -n 8,25p $CONFIG)
|
||||
.
|
||||
wq
|
||||
END
|
||||
Reference in New Issue
Block a user