代码拉取完成,页面将自动刷新
#!/bin/bash
set -o errexit
readonly CLOBBER_FILE="/mnt/stateful_partition/.update_available"
readonly CHROME_DEV_FILE="/etc/chrome_dev.conf"
mount_rw() {
mount -o remount,rw /
}
mount_ro() {
mount -o remount,ro /
}
check_user() {
if [[ $EUID -ne 0 ]]; then
echo "Please run this script as root or prepend sudo, abort."
exit 1
fi
}
set_chrome_dev() {
if grep -q "fydeos-device-management-url" "$CHROME_DEV_FILE"; then
echo "The flag fydeos-device-management-url may have been set"
else
echo "Add fydeos-device-management-url to chrome_dev file"
echo "--fydeos-device-management-url=https://policy.demo.fydeos.com/" >> "$CHROME_DEV_FILE"
fi
}
clobber() {
echo "Reset device"
echo "clobber" > "$CLOBBER_FILE"
}
exec_command() {
mount_rw
set_chrome_dev
clobber
mount_ro
}
warn_then_exec() {
while true; do
read -p "This script will reset the deivce, all user data will be wiped, continue? (Y/N) " c
case $c in
[Yy]* ) exec_command; break;;
[Nn]* ) exit;;
* ) echo "Please answer yes or no.";;
esac
done
}
done_msg() {
echo "Done, please reboot the device."
}
main() {
check_user
warn_then_exec
done_msg
}
main "$@"
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。