Changeset 9651 for utils/build/mk/Fclean_config.sh
- Timestamp:
- 2018-05-28T08:47:14+02:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
utils/build/mk/Fclean_config.sh
r9598 r9651 63 63 # 64 64 #- 65 NEW_CONF=${x_n} 66 if [ ${#NEW_CONF} -eq 0 ] ; then 67 echo " " 68 echo "No configuration specified, please use makenemo -n CONFIG clean_config " 69 else 70 echo "Are you sure that you want to remove this directory $NEW_CONF? [y/n] " 71 read answer 72 answer=`echo $answer | sed 's/^[y].*$/y/'` 73 if [ -z "$answer" -o "x$answer" = "xy" ]; then 74 # testing if configuration exists 75 if [ "$(cat ${CONFIG_DIR}/cfg.txt | grep "${NEW_CONF} ")" == "" ] ; then 76 echo "The configuration ${NEW_CONF} does not exist in file cfg.txt" 77 echo "No removing configuration" 78 echo " " 79 else 80 rm -rf ${CONFIG_DIR}/${NEW_CONF} 81 sed -e "/${NEW_CONF} /d" ${CONFIG_DIR}/cfg.txt > ${CONFIG_DIR}/cfg.tmp 82 mv ${CONFIG_DIR}/cfg.tmp ${CONFIG_DIR}/cfg.txt 83 echo "${NEW_CONF} configuration REMOVED" 84 fi 85 else 86 echo " " 87 echo "nothing to remove" 88 fi 89 fi 90 unset -v answer 65 66 NEW_CONF=${x_n} 67 68 if [ ${#NEW_CONF} -eq 0 ] ; then 69 echo " " 70 echo "No configuration specified, please use makenemo -n CONFIG clean_config " 71 else 72 echo "Are you sure that you want to remove this directory $NEW_CONF? [y/n] " 73 read answer 74 answer=`echo $answer | sed 's/^[y].*$/y/'` 75 76 if [ -z "$answer" -o "x$answer" = "xy" ]; then 77 78 ## testing if configuration exists 79 if [[ ! $( grep "${NEW_CONF} " */work_cfgs.txt ) ]] ; then 80 echo "The configuration ${NEW_CONF} does not exist in file work_cfgs.txt" 81 echo "No removing configuration" 82 echo " " 83 else 84 CONFIG_DIR=${MAIN_DIR}/$( grep -l "${NEW_CONF} " */work_cfgs.txt | cut -d/ -f1 ) 85 rm -rf ${CONFIG_DIR}/${NEW_CONF} 86 sed -e "/${NEW_CONF} /d" ${CONFIG_DIR}/work_cfgs.txt > ${CONFIG_DIR}/work_cfgs.tmp 87 mv ${CONFIG_DIR}/work_cfgs.tmp ${CONFIG_DIR}/work_cfgs.txt 88 echo "${NEW_CONF} configuration REMOVED" 89 fi 90 91 else 92 echo " " 93 echo "nothing to remove" 94 fi 95 96 fi 97 98 unset -v answer
Note: See TracChangeset
for help on using the changeset viewer.