migrate_to_3.2.3

来自「一套客户/服务器模式的备份系统代码,跨平台,支持linux,AIX, IRIX,」· 3 代码 · 共 53 行

3
53
字号
#!/bin/shecho 'This script is quite dumb, it asks you more questions'echo 'than you might think is necessary. However, this script'echo 'is meant to run exactly one time.'echo ' 'cleanup(){  /bin/rm -f $TMPFILE  exit $EST}EST=0TMPFILE=/tmp/afbu_update_mininfo.3.2.3.$$trap cleanup 2trap cleanup 15echo "Please enter the full path to your server configuration file:"EXISTS=nowhile read CONFIGFILE ; do  if [ ! -r $CONFIGFILE ] ; then    echo "Error: The file $CONFIGFILE is not readable. Please check and try again."    continue  fi  breakdoneecho ' 'cat $CONFIGFILE | awk '{if($0 ~ "^[ 	]*[Ll]ast[-_ 	]*[Cc]artr?i?d?g?e?s[-_ 	]*:?") {sub("^[^0-9]*",""); printf "CartridgeSets:		"; for(i=1;i<=NF;i++){idx=1;for(j=1;j<=NF;j++){if($j<$i && idx<$j+1) idx=$j+1;} printf " %d-%d",idx,$i;} printf "\n";} else { print } }' > $TMPFILESAVEFILE="$CONFIGFILE".`date +%y%m%d%H%M%S`cp "$CONFIGFILE" "$SAVEFILE" \  && /bin/rm -f "$CONFIGFILE" \  && cp $TMPFILE "$CONFIGFILE"if [ $? -ne 0 ] ; then  echo Error: Creating new configuration file failed.fiecho "The differences between old and new configuration file are:"diff "$SAVEFILE" "$CONFIGFILE"if [ $? -eq 0 ] ; then  echo '(none)'fiecho " "echo "If you think, this is not ok, please edit manually."echo "Your old configuration file is saved as $SAVEFILE"cleanup

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?