From 0770d664b6ed0442b287fcc791c734de4e9614ec Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Fri, 3 Jun 2022 21:52:57 +0200 Subject: [PATCH] added some suggestions --- news_to_ismas | 112 ++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 90 insertions(+), 22 deletions(-) diff --git a/news_to_ismas b/news_to_ismas index 53f7eb6..80024c4 100755 --- a/news_to_ismas +++ b/news_to_ismas @@ -15,46 +15,114 @@ if [ ${news_to_ismas_sourced:-1} = "1" ]; then # include only once }" echo $((echo "$data"; sleep 1) | nc localhost $APISM_DB_PORT) } - - reset_update_trigger () { - news_to_ismas "U0002" - return $? - } - # only for testing - set_updates_available () { - news_to_ismas "U99" - return $? - } - - update_started () { + # WAIT + update_psa_activated () { news_to_ismas "U0010" return $? } - - update_in_progress () { - news_to_ismas "U0011" + + # git pull + update_psa_pull_customer_repository () { + # text im PARAMETER? + news_to_ismas "U0011" "git pull customer repository" return $? } - update_finished () { - news_to_ismas "U0012" + update_psa_backup () { + news_to_ismas "U0011" "backup before update steps" return $? } - update_failed () { - news_to_ismas "U0003" + update_psa_check_hash_values () { + news_to_ismas "U0011" "checking file integrity" + return $? + } + + update_psa_check_hardware_compatibility () { + news_to_ismas "U0011" "check hardware compatiblity" + return $? + } + + # conf/ini files + update_psa_copy_files () { + news_to_ismas "U0011" "copy conf/ini-files" + return $? + } + + # exec opkg-commands (dry-run) + update_psa_install_packages_dry_run () { + news_to_ismas "U0011" "install opkg-packages (dry-run)" + return $? + } + + # exec opkg-commands + update_psa_install_packages () { + news_to_ismas "U0011" "install opkg-packages" + return $? + } + + # remove backup in case of success + update_psa_cleanup () { + news_to_ismas "U0011" "cleanup" + return $? + } + + update_psa_finished () { + news_to_ismas "U0012" return $? } - update_success () { - news_to_ismas "U0001" + # results + update_psa_succeeded () { + news_to_ismas "U0001" "updates installed" + return $? + } + + reset_update_trigger () { + news_to_ismas "U0002" "updates activated" return $? } + update_psa_canceled_no_updates_available () { + # text im PARAMETER? + news_to_ismas "U0003" # "No updates available, but 'WAIT' active. Missing check-in?" + return $? + } + + update_psa_backup_failed () { + news_to_ismas "U0003" # "Backup failed" + return $? + } + + update_psa_wrong_hash_values () { + news_to_ismas "U0003" # "Wrong hash value for file . Missing check-in?" + return $? + } + + update_psa_hardware_not_compatible () { + news_to_ismas "U0003" "conf/ini-file and psa hardware not compatible" + return $? + } + + update_psa_opkg_command_failure () { + news_to_ismas "U0003" "opkg-command failed" + return $? + } + + update_psa_failed () { + news_to_ismas "U0003" "Unknown error" + return $? + } + + # only for testing + set_updates_available () { + news_to_ismas "U0099" + return $? + } + set_update_active () { reset_update_trigger return $? } - fi