summarylogtreecommitdiffstats
path: root/register_widevine_firefox
diff options
context:
space:
mode:
authorBart De Vries2020-10-12 23:53:05 +0200
committerBart De Vries2020-10-12 23:53:05 +0200
commitcb3d87b38708c5cbb0bf97ff89ca5e7cf37b820c (patch)
tree1de05553b2c10e274555d70794ee29258942c115 /register_widevine_firefox
downloadaur-cb3d87b38708c5cbb0bf97ff89ca5e7cf37b820c.tar.gz
Initial version of widevine-armv7h package
Diffstat (limited to 'register_widevine_firefox')
-rwxr-xr-xregister_widevine_firefox37
1 files changed, 37 insertions, 0 deletions
diff --git a/register_widevine_firefox b/register_widevine_firefox
new file mode 100755
index 000000000000..a7fe4092aee1
--- /dev/null
+++ b/register_widevine_firefox
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+if [[ ! -e "${HOME}/.mozilla/firefox" ]]
+then
+ echo "No firefox profiles found for user ${USER}"
+ exit
+fi
+
+cd ${HOME}/.mozilla/firefox/
+if [[ $(grep '\[Profile[^0]\]' profiles.ini) ]]
+ then PROFPATH=$(grep -E '^\[Profile|^Path|^Default' profiles.ini | grep '^Path' | cut -c6-)
+ else PROFPATH=$(grep 'Path=' profiles.ini | sed 's/^Path=//')
+fi
+PROFS=($PROFPATH)
+
+for prof in "${PROFS[@]}"
+do
+ WIDEVINE_PATH="${HOME}/.mozilla/firefox/${prof}/gmp-widevinecdm"
+ if [[ -e "${WIDEVINE_PATH}" ]]
+ then
+ if [[ -L "${WIDEVINE_PATH}" ]]
+ then
+ rm "${WIDEVINE_PATH}"
+ else
+ rm -r "${WIDEVINE_PATH}"
+ fi
+ ln -s /opt/WidevineCdm/firefox "${WIDEVINE_PATH}"
+ echo "Widevine already registered for profile ${prof}; re-registered"
+ else
+ if [[ -L "${WIDEVINE_PATH}" ]]
+ then
+ rm "${WIDEVINE_PATH}"
+ fi
+ ln -s /opt/WidevineCdm/firefox "${HOME}/.mozilla/firefox/${prof}/gmp-widevinecdm"
+ echo "Widevine registered for profile ${prof}"
+ fi
+done