diff --git a/README.md b/README.md index 515f102..0f7f43b 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ bash reinstall.sh centos-7 (或其他系统) bash reinstall.sh windows --iso=https://example.com/zh-cn_windows_10_enterprise_ltsc_2021_x64_dvd_033b7312.iso --image-name='Windows 10 Enterprise LTSC 2021' dd: -bash reinstall.sh dd --ddimg=https://example.com/xxx.gz +bash reinstall.sh dd --img=https://example.com/xxx.gz 重启: reboot diff --git a/reinstall.sh b/reinstall.sh index 1aeac50..8305fb9 100644 --- a/reinstall.sh +++ b/reinstall.sh @@ -128,13 +128,13 @@ setos() { } setos_dd() { - if [ -z "$ddimg" ]; then - echo "dd need --ddimg" + if [ -z "$img" ]; then + echo "dd need --img" exit 1 fi - test_url $ddimg 'xz|gz' - eval "${step}_ddimg='$ddimg'" - eval "${step}_ddimg_type='$img_type'" + test_url $img 'xz|gz' + eval "${step}_img='$img'" + eval "${step}_img_type='$img_type'" } setos_redhat() { @@ -250,7 +250,7 @@ if [ "$EUID" -ne 0 ]; then exit 1 fi -if ! opts=$(getopt -a -n $0 --options l --long localtest,iso:,image-name:,ddimg: -- "$@"); then +if ! opts=$(getopt -a -n $0 --options l --long localtest,iso:,image-name:,img: -- "$@"); then usage_and_exit fi @@ -262,8 +262,8 @@ while true; do confhome=$localtest_confhome shift ;; - --ddimg) - ddimg=$2 + --img) + img=$2 shift 2 ;; --iso) diff --git a/trans.sh b/trans.sh index ac0da76..0378e07 100644 --- a/trans.sh +++ b/trans.sh @@ -91,7 +91,7 @@ if [ "$distro" = "alpine" ]; then exec reboot elif [ "$distro" = "dd" ]; then - case "$ddimg_type" in + case "$img_type" in gz) prog=gzip ;; xz) prog=xz ;; esac @@ -99,7 +99,7 @@ elif [ "$distro" = "dd" ]; then if [ -n "$prog" ]; then # alpine busybox 自带 gzip xz,但官方版也许性能更好 apk add curl $prog - curl -L $ddimg | $prog -dc >/dev/$xda + curl -L $img | $prog -dc >/dev/$xda else echo 'Not supported' sleep 1m