add find grub path, typo

This commit is contained in:
Ing 2023-05-04 01:45:03 +08:00
parent ab30869e91
commit 4294578a36
2 changed files with 6 additions and 3 deletions

View File

@ -8,5 +8,8 @@ function use() {
[ -z "${1}" ] && use [ -z "${1}" ] && use
[ "${1}" != "junior" -a "${1}" != "config" ] && use [ "${1}" != "junior" -a "${1}" != "config" ] && use
echo "Rebooting to ${1} mode" echo "Rebooting to ${1} mode"
grub-editenv /mnt/p1/boot/grub/grubenv set next_entry="${1}" GRUBPATH="$(dirname $(find /mnt/p1/ -name grub.cfg | head -1))"
ENVFILE="${GRUBPATH}/grubenv"
[ ! -f "${ENVFILE}" ] && grub-editenv ${ENVFILE} create
grub-editenv ${ENVFILE} set next_entry="${1}"
reboot reboot

View File

@ -48,8 +48,8 @@ def synoextractor(url):
commands = ['sudo', 'rm', '-rf', filename, filepath] commands = ['sudo', 'rm', '-rf', filename, filepath]
result = subprocess.check_output(commands) result = subprocess.check_output(commands)
req = requests.get(url.replace(urlparse(url).netloc, 'cndl.synology.cn')) # req = requests.get(url.replace(urlparse(url).netloc, 'cndl.synology.cn'))
#req = requests.get(url) req = requests.get(url)
with open(filename, "wb") as f: with open(filename, "wb") as f:
f.write(req.content) f.write(req.content)