--- mcore-src/trunk/mcore-tools/src/modules/basic-version/version.client.class.in 2015/12/16 14:42:45 2701 +++ mcore-src/trunk/mcore-tools/src/modules/basic-version/version.client.class.in 2015/12/17 12:02:10 2702 @@ -20,6 +20,15 @@ mecho " Prints the current netboot state." } +help_version_deactivated() +{ + mecho "get version.deactivated" + mecho " Shows the current state of the system." + mecho + mecho "set version.deactivated [0|1]" + mecho " Sets the state of the system." +} + get_version_os() { local version @@ -74,3 +83,34 @@ rvecho "${netboot}" } + +get_version_deactivated() +{ + local deactivated=0 + [[ -e ${MCORE_CONFIG_PATH}/client-deactivated ]] && deactivated=1 + rvecho "${deactivated}" +} + +set_version_deactivated() +{ + local deactivated="${CLASS_ARGV[0]}" + case "${deactivated}" in + 0) if [[ -e ${MCORE_CONFIG_PATH}/client-deactivated ]] + then + rm ${MCORE_CONFIG_PATH}/client-deactivated + fi + rvecho "Client activated" + ;; + + 1) if [[ ! -e ${MCORE_CONFIG_PATH}/client-deactivated ]] + then + touch ${MCORE_CONFIG_PATH}/client-deactivated + fi + rvecho "Client deactivated" + ;; + + *) decho "Unknown state '${deactivated}'" + help_version_deactivated + ;; + esac +}