Added $WIFI_DEVICE in 'clone.conf' to allow new wireless interface names + minfixes (gzip invalid condition + spacing)

This commit is contained in:
xdrm-brackets 2018-01-24 16:42:35 +01:00
parent dbc2646478
commit a7acce6eba
2 changed files with 13 additions and 8 deletions

View File

@ -132,22 +132,25 @@ step3(){
# (2) Burning image into disk #
# if GZIP
if [ "IMAGE_ZIP" = "1" ]; then
if [ "$IMAGE_GZIP" = "1" ]; then
echo " - using gunzip";
( dd if=$IMAGE_FILE | pv -s $(du -bs $IMAGE_FILE | gunzip | awk '{print $1}') | sudo dd of=$DEV bs=4M ) \
|| (echo "<<< error: dd command failed"; exit);
|| echo "<<< error: dd command failed" || exit 1;
else
( dd if=$IMAGE_FILE | pv -s $(du -bs $IMAGE_FILE | awk '{print $1}') | sudo dd of=$DEV bs=4M ) \
|| (echo "<<< error: dd command failed"; exit);
|| echo "<<< error: dd command failed" || exit 1;
fi;
echo " - emptying memory buffers to disk";
sync;
echo "<<< done";
@ -409,7 +412,7 @@ step7(){
# (6) Enable sats-dwc@wlan0 at startup #
echo " (.) Emulate \`systemctl enable sats-dwc@wlan0.service\`";
sudo ln -fs /lib/systemd/system/sats-dwc@.service /mnt/etc/systemd/system/multi-user.target.wants/sats-dwc@wlan0.service;
sudo ln -fs /lib/systemd/system/sats-dwc@.service /mnt/etc/systemd/system/multi-user.target.wants/sats-dwc@$WIFI_DEVICE.service;
# (7) Enable firewall@default at startup #
echo " (.) Emulate \`systemctl enable firewall@default.service\`";
@ -440,7 +443,7 @@ step7(){
# (6) Create sats-dwc@wlan0 script #
echo " (.) Create sats-dwc@wlan0 script";
cat ./utility/wlan0.dwc | sed "s/\*\*\*SALT\*\*\*/$WIFI_SALT/" | sed "s/\*\*\*PEPPER\*\*\*/$WIFI_PEPPER/" | sudo tee /mnt/etc/wpa_supplicant/wlan0.dwc > /dev/null;
cat ./utility/wlan0.dwc | sed "s/\*\*\*SALT\*\*\*/$WIFI_SALT/" | sed "s/\*\*\*PEPPER\*\*\*/$WIFI_PEPPER/" | sudo tee /mnt/etc/wpa_supplicant/$WIFI_DEVICE.dwc > /dev/null;
# (7) Create firewall@default script #
echo " (.) Create firewall@default script";

View File

@ -5,6 +5,7 @@ export IMAGE_FILE="original.img";
export IMAGE_GZIP="0";
# WIFI SETTINGS
export WIFI_DEVICE="wlan0";
export WIFI_SALT="W8DgnYq_TakTMbL2pg9VrLkumK7BR1jsoUhuUDrQhbBCmqoHHXrRguCPazoPnXVXAdScy8HNaeJpaTXlUS2QRXkHAWW5ITcik_sa8BNn27hWy_JCX7DIGeCW0D3ZnbH0RdLqGSLv0dOPzyyOX97lt1rObji_1hKJ42B6E4iyVH1Jlm2FZrPnSxtoC1g1jvQilaH3NCi2jP5dv0ZT_qfJTibhXEg9FvBLPpkTR6DWsPKJ_tihlC0SDUi5v2L6VM9i";
export WIFI_PEPPER="DPJdwTm9zj0KdaBY5jcz3GlrZzItSe4gzPJgY_p95yLCBgpEfCSslQxidWTflgyKOLvTwEo3kDQjCR78bk5V477NiiaLIxfKux_vdThjl4d136VIAfdupgKC5expOVUUMs8zymRYMwr02xRKEd8uUX4W1C46gzxE37QFfHw3rWsT_SMhUeOo5yu_cZRkO3O2HFDl_2uQonlQi9O8LSY_UY0MvVfw4IEvEsSnwttVc99QmJMrdyUJKyrwPEfk1rQG";
@ -13,7 +14,7 @@ export SERVER_HOSTNAME="xdrm.io";
export SERVER_USERNAME="satsd";
# DEFAULT SATS SETTINGS
export MACHINE_ID="127";
export MACHINE_ID="122"; # surgel1
export MACHINE_BRANCH="1.0";
export MACHINE_STATE="000";
export API_URL="https://logauth.xdrm.io/api/machineDefault";
@ -21,3 +22,4 @@ export MACHINE_SECRET=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 250);
export NEXT_SECRET=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 250);
export UNLOCK_CODE=$(tr -dc a-f0-9 < /dev/urandom | head -c 128);
export WAREHOUSE_TOKEN="52131065a906de90e26da0732e58400edd6739cfa03fc658e7593abef4a4504e18e66e1a8fe9da374a8e8f753603463e4777789262b3ee945d4bf72dd8d6399c";
f