Index: scripts/factory_reset.sh =================================================================== diff -u -r1e9d99fa2087d302e69c616b5a2420e010abe164 -rf822c3490ef34c2c800020543bcb6afcb959de4a --- scripts/factory_reset.sh (.../factory_reset.sh) (revision 1e9d99fa2087d302e69c616b5a2420e010abe164) +++ scripts/factory_reset.sh (.../factory_reset.sh) (revision f822c3490ef34c2c800020543bcb6afcb959de4a) @@ -28,7 +28,7 @@ ERR_REMOVE_DEL_DIR=154 ERR_REMOVE_DEL_FIL=155 -ERR_CLEAN_SETTINGS_CONF_PASSNOTFOUNT=159 +ERR_CLEAN_SETTINGS_CONF_PASSNOTFOUND=159 ERR_CLEAN_SETTINGS_CONF_OVERWRITE=160 ERR_CLEAN_SETTINGS_DFLT_RESTORE=161 @@ -92,7 +92,7 @@ } # checks if the passed argument exists -function exits() +function exists() # $1 - string: the argument to be detected { local _ok_=$FALSE @@ -102,7 +102,7 @@ echo $_ok_ } -# exits with the exit code if the condistion ($1) is non-zero +# exits with the exit code if the condition ($1) is non-zero function exitError () # $1 - number: boolean result to exit if non-zero, with exit code # $1 - number: exit code @@ -117,7 +117,7 @@ fi } -# removes all the files in the directory and subdirectory in a recursive manner +# removes all the files in the directory and sub-directory in a recursive manner function clearFolderContent() # $1 - Directory path # $2 - Directory alias name @@ -164,13 +164,13 @@ servicePasswordLine=$(grep -A1 "\[Service\]" "$LOC_SETTINGS_CONF" | grep Password) # store the service password line _has_error_=$( [[ "$servicePasswordLine" ]] && $(true) || $(false) ) - exitError $_has_error_ $ERR_CLEAN_SETTINGS_CONF_PASSNOTFOUNT "Password not found in '$LOC_SETTINGS_CONF'" + exitError $_has_error_ $ERR_CLEAN_SETTINGS_CONF_PASSNOTFOUND "Password not found in '$LOC_SETTINGS_CONF'" cp $LOC_SETTINGS_DFLT $LOC_SETTINGS_CONF # reset the settings to default settings _has_error_=$? exitError $_has_error_ $ERR_CLEAN_SETTINGS_CONF_OVERWRITE "Service settings overwrite filed" - sed -i "s/^.*Password.*$/$storedPassword/" $LOC_SETTINGS_CONF # keep the service passowrd + sed -i "s/^.*Password.*$/$storedPassword/" $LOC_SETTINGS_CONF # keep the service password _has_error_=$? exitError $_has_error_ $ERR_CLEAN_SETTINGS_DFLT_RESTORE "Service password restore filed" }