This repository has been archived on 2023-12-23. You can view files and clone it, but cannot push or open issues or pull requests.
office/get_office.sh
2023-10-02 18:44:35 +02:00

19 lines
627 B
Bash
Executable File

#!/bin/bash -e
# https://answers.microsoft.com/en-us/msoffice/forum/all/useful-microsoft-download-links-for-office-direct/7bcaa971-9493-44b6-a1ba-0db4c6957c47
# Office 2016 Home & Student
URL='http://officecdn.microsoft.com/pr/492350f6-3a01-4f97-b9c0-c7c6ddf67d60/media/en-us/HomeStudentRetail.img'
curl -C- -o O2016HS.img "$URL"
DEV="$(udisksctl loop-setup -f O2016HS.img | awk '{print $NF}' | awk 1 RS='.\n')"
DIR="$(udisksctl mount -b "$DEV" | awk '{print $NF}')"
cp -Trv "$DIR" office/ || true
umount "$DIR"
udisksctl loop-delete -b "$DEV"
find office/ -type d -exec chmod 755 '{}' + -o -type f -exec chmod 644 {} +