Просмотр исходного кода

Change tox bootstrap path for amnesic

Bob Mottram 8 лет назад
Родитель
Сommit
8d69b56702
1 измененных файлов: 9 добавлений и 3 удалений
  1. 9
    3
      src/freedombone-image-mesh

+ 9
- 3
src/freedombone-image-mesh Просмотреть файл

421
 
421
 
422
 	TOXIC_FILE=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-tox | grep "TOXIC_FILE=" | head -n 1 | awk -F '=' '{print $2}')
422
 	TOXIC_FILE=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-tox | grep "TOXIC_FILE=" | head -n 1 | awk -F '=' '{print $2}')
423
 
423
 
424
+	if [ -f $MESH_AMNESIC ]; then
425
+		# change to the amnesic mount
426
+		sed -i 's|/var/lib/tox-bootstrapd|/media/tox-bootstrapd|g' /etc/tox-bootstrapd.conf
427
+	fi
428
+
424
 	echo $'Enabling toxcore daemon' >> $INSTALL_LOG
429
 	echo $'Enabling toxcore daemon' >> $INSTALL_LOG
425
 	systemctl enable tox-bootstrapd.service
430
 	systemctl enable tox-bootstrapd.service
426
 
431
 
433
 	# sleep for a while so that the tox keys can be generated
438
 	# sleep for a while so that the tox keys can be generated
434
 	sleep 30
439
 	sleep 30
435
 	TOX_BOOTSTRAP_ID_FILE=/var/lib/tox-bootstrapd/pubkey.txt
440
 	TOX_BOOTSTRAP_ID_FILE=/var/lib/tox-bootstrapd/pubkey.txt
441
+	if [ -f $MESH_AMNESIC ]; then
442
+		TOX_BOOTSTRAP_ID_FILE=/media/tox-bootstrapd/pubkey.txt
443
+	fi
436
 	TOX_PUBLIC_KEY=$(cat /var/log/syslog | grep tox | grep "Public Key" | awk -F ' ' '{print $8}' | tail -1)
444
 	TOX_PUBLIC_KEY=$(cat /var/log/syslog | grep tox | grep "Public Key" | awk -F ' ' '{print $8}' | tail -1)
437
 	if [ ${#TOX_PUBLIC_KEY} -lt 30 ]; then
445
 	if [ ${#TOX_PUBLIC_KEY} -lt 30 ]; then
438
 		echo $'WARNING: Could not obtain the tox node public key' >> $INSTALL_LOG
446
 		echo $'WARNING: Could not obtain the tox node public key' >> $INSTALL_LOG
547
 		tomb >> /var/log/${PROJECT_NAME}.log
555
 		tomb >> /var/log/${PROJECT_NAME}.log
548
 	fi
556
 	fi
549
 	TOMB_TEMP_PASSWORD="$(openssl rand -base64 32 | cut -c1-30)"
557
 	TOMB_TEMP_PASSWORD="$(openssl rand -base64 32 | cut -c1-30)"
550
-	echo "$TOMB_TEMP_PASSWORD" > /mnt/ramdisk/${tomb_name}.tomb.pass
551
 	tomb forge /mnt/ramdisk/${tomb_name}.tomb.key --tomb-pwd "${TOMB_TEMP_PASSWORD}" --unsafe
558
 	tomb forge /mnt/ramdisk/${tomb_name}.tomb.key --tomb-pwd "${TOMB_TEMP_PASSWORD}" --unsafe
552
 	tomb lock /tmp/${tomb_name}.tomb -k /mnt/ramdisk/${tomb_name}.tomb.key --tomb-pwd "${TOMB_TEMP_PASSWORD}" --unsafe
559
 	tomb lock /tmp/${tomb_name}.tomb -k /mnt/ramdisk/${tomb_name}.tomb.key --tomb-pwd "${TOMB_TEMP_PASSWORD}" --unsafe
553
 	tomb open /tmp/${tomb_name}.tomb -k /mnt/ramdisk/${tomb_name}.tomb.key --tomb-pwd "${TOMB_TEMP_PASSWORD}" --unsafe
560
 	tomb open /tmp/${tomb_name}.tomb -k /mnt/ramdisk/${tomb_name}.tomb.key --tomb-pwd "${TOMB_TEMP_PASSWORD}" --unsafe
554
-	# update /etc/crypttab so that the rest of the os has access
555
-	cryptsetup luksAddKey --key-file=/mnt/ramdisk/${tomb_name}.tomb.key /tmp/${tomb_name}.tomb newkey --password="${TOMB_TEMP_PASSWORD}"
561
+	gsettings set org.mate.caja.desktop volumes-visible false
556
 
562
 
557
 	# stop stuff from popping up
563
 	# stop stuff from popping up
558
 	pkill caja
564
 	pkill caja