Skip to content

Commit

Permalink
add flag
Browse files Browse the repository at this point in the history
  • Loading branch information
weearc committed Sep 5, 2020
1 parent 0e4d929 commit f6a4aed
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 30 deletions.
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ scp CQU_drcom* -r [email protected]:/root/.
## CHANGE LOG
2020.09.06
- 添加了循环判断,用于当信息填写有误时的修改而不用重新运行脚本
- 添加了 `--dry-run` 运行选项以方便进行测试

2020.08 - 2020.09.05
- 修正配置更改
Expand Down
110 changes: 80 additions & 30 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -447,42 +447,92 @@ setup_done() {
echo " you may find only one ssid of your routine in the list."
echo "--------------------"
}

# config renew after sys-upgrade
read -p "Is is installation after system upgrade? [y/N]: " ifSet_upgrade
case $ifSet_upgrade in
n|N|"")
if [[ $1 == "--dry-run" ]]; then
clear
echo "This flag is for test and will print most of the variables."
hello
network_config
root_pwd_change
inform_gather
wlan_ssid_settings
wlan_passwd_setting
# recheck
setup_confirm
# clean_up
# setup_packages
# setup_drcom
# setup_crontab
# setup_wlan
setup_done
;;
y|Y)
clear
wifi_ssid0="the one you have set"
wifi_ssid1="the one you have set"
wifi_password0="the one you have set"
wifi_password1="the one you have set"
hello
network_config
inform_gather
# recheck
setup_confirm
# setup_packages
# setup_drcom
# setup_crontab
setup_done
echo "All done!"
;;
esac
else
# config renew after sys-upgrade
read -p "Is is installation after system upgrade? [y/N]: " ifSet_upgrade
case $ifSet_upgrade in
n|N|"")
clear
hello
network_config
root_pwd_change
inform_gather
wlan_ssid_settings
wlan_passwd_setting
# recheck
setup_confirm
clean_up
setup_packages
setup_drcom
setup_crontab
setup_wlan
setup_done
;;
y|Y)
clear
wifi_ssid0="the one you have set"
wifi_ssid1="the one you have set"
wifi_password0="the one you have set"
wifi_password1="the one you have set"
hello
network_config
inform_gather
# recheck
setup_confirm
setup_packages
setup_drcom
setup_crontab
setup_done
echo "All done!"
;;
esac
fi
# config renew after sys-upgrade
# read -p "Is is installation after system upgrade? [y/N]: " ifSet_upgrade
# case $ifSet_upgrade in
# n|N|"")
# clear
# hello
# network_config
# root_pwd_change
# inform_gather
# wlan_ssid_settings
# wlan_passwd_setting
# # recheck
# setup_confirm
# clean_up
# setup_packages
# setup_drcom
# setup_crontab
# setup_wlan
# setup_done
# ;;
# y|Y)
# clear
# wifi_ssid0="the one you have set"
# wifi_ssid1="the one you have set"
# wifi_password0="the one you have set"
# wifi_password1="the one you have set"
# hello
# network_config
# inform_gather
# # recheck
# setup_confirm
# setup_packages
# setup_drcom
# setup_crontab
# setup_done
# echo "All done!"
# ;;
# esac

0 comments on commit f6a4aed

Please sign in to comment.