diff --git a/src/freedombone-utils-final b/src/freedombone-utils-final index 11270c76..6f5d672a 100755 --- a/src/freedombone-utils-final +++ b/src/freedombone-utils-final @@ -31,50 +31,57 @@ OPEN_PORTS=() function install_final { - if grep -Fxq "install_final" $COMPLETION_FILE; then - return - fi - # unmount any attached usb drive - if [ -d $USB_MOUNT ]; then - umount $USB_MOUNT - rm -rf $USB_MOUNT - fi - function_check split_gpg_key_into_fragments - split_gpg_key_into_fragments - echo 'install_final' >> $COMPLETION_FILE - clear - echo '' + if grep -Fxq "install_final" $COMPLETION_FILE; then + return + fi + # unmount any attached usb drive + if [ -d $USB_MOUNT ]; then + umount $USB_MOUNT + rm -rf $USB_MOUNT + fi + function_check split_gpg_key_into_fragments + split_gpg_key_into_fragments + echo 'install_final' >> $COMPLETION_FILE + clear + echo '' - echo $" - *** ${PROJECT_NAME} installation is complete. Rebooting... *** + echo $" + *** ${PROJECT_NAME} installation is complete. Rebooting... *** - Now forward these ports from your internet router + Now forward these ports from your internet router " - for p in "${OPEN_PORTS[@]}" - do - echo " $p" - done - echo '' + for p in "${OPEN_PORTS[@]}" + do + echo " $p" + done + echo '' - if [ -f "/home/$MY_USERNAME/README" ]; then - echo $"See /home/$MY_USERNAME/README for post-installation instructions." - echo '' - fi - # add user menu on ssh login - if ! grep -q 'control' /home/$MY_USERNAME/.bashrc; then - echo 'control' >> /home/$MY_USERNAME/.bashrc - fi - if [ ! -f $IMAGE_PASSWORD_FILE ]; then - reboot - fi + if [ -f "/home/$MY_USERNAME/README" ]; then + echo $"See /home/$MY_USERNAME/README for post-installation instructions." + echo '' + fi + # add user menu on ssh login + if ! grep -q 'control' /home/$MY_USERNAME/.bashrc; then + echo 'control' >> /home/$MY_USERNAME/.bashrc + fi + if [ ! -f $IMAGE_PASSWORD_FILE ]; then + reboot + fi +} + +function update_installed_apps_list { + cat $COMPLETION_FILE | grep "install_" > /usr/share/${PROJECT_NAME}/installed.txt } function setup_final { - function_check install_tripwire - install_tripwire + function_check update_installed_apps_list + update_installed_apps_list - function_check install_final - install_final + function_check install_tripwire + install_tripwire + + function_check install_final + install_final } # NOTE: deliberately no exit 0 diff --git a/src/freedombone-utils-selector b/src/freedombone-utils-selector index 718293d1..01eead40 100755 --- a/src/freedombone-utils-selector +++ b/src/freedombone-utils-selector @@ -64,6 +64,15 @@ function app_is_installed { return fi + if [ -f /usr/share/${PROJECT_NAME}/installed.txt ]; then + if ! grep -Fxq "install_${app_name}" /usr/share/${PROJECT_NAME}/installed.txt; then + echo "0" + else + echo "1" + fi + return + fi + if ! grep -Fxq "install_${app_name}" $COMPLETION_FILE; then echo "0" else @@ -206,6 +215,7 @@ function remove_apps { fi app_index=$[app_index+1] done + update_installed_apps_list } function install_apps { @@ -228,6 +238,7 @@ function install_apps { fi app_index=$[app_index+1] done + update_installed_apps_list } # NOTE: deliberately no exit 0