Hook for RedHat based systems (using dnf package manager). Untested.

This commit is contained in:
Ld-Hagen
2021-10-26 20:59:59 +03:00
parent 8c64261203
commit 52954635c8
2 changed files with 8 additions and 1 deletions

View File

@@ -29,6 +29,7 @@ create_hook ()
printf 'Choose your Linux distro:\n' printf 'Choose your Linux distro:\n'
printf ' 1. Debian-based (Debian/Ubuntu/Mint/etc.)\n' printf ' 1. Debian-based (Debian/Ubuntu/Mint/etc.)\n'
printf ' 2. Arch-based (Arch/Manjaro/etc.)\n' printf ' 2. Arch-based (Arch/Manjaro/etc.)\n'
printf ' 3. RedHat-based (RedHat/Fedora/etc.)\n'
printf ' 0. Other\n' printf ' 0. Other\n'
while read -p "Your choice: " DISTRIB; do while read -p "Your choice: " DISTRIB; do
case $DISTRIB in case $DISTRIB in
@@ -38,10 +39,15 @@ create_hook ()
printf 'Now the script will run automatically every time apt installs or updates Opera.\n' printf 'Now the script will run automatically every time apt installs or updates Opera.\n'
break;; break;;
"2" ) "2" )
cp -f $SCRIPT_PATH/scripts/fix-opera.hook $INSTALL_PATH /usr/share/libalpm/hooks cp -f $SCRIPT_PATH/scripts/fix-opera.hook $INSTALL_PATH
ln -sf $INSTALL_PATH/fix-opera.hook /usr/share/libalpm/hooks/ ln -sf $INSTALL_PATH/fix-opera.hook /usr/share/libalpm/hooks/
printf 'Now the script will run automatically every time pacman installs or updates Opera.\n' printf 'Now the script will run automatically every time pacman installs or updates Opera.\n'
break;; break;;
"3" )
cp -f $SCRIPT_PATH/scripts/fix-opera.action $INSTALL_PATH
ln -sf $INSTALL_PATH/fix-opera.action /etc/dnf/plugins/post-transaction-actions.d/
printf 'Now the script will run automatically every time dnf installs or updates Opera.\n'
break;;
"0" ) "0" )
printf "Autostart for your Linux distro is currently unsupported\n" printf "Autostart for your Linux distro is currently unsupported\n"
break;; break;;

1
scripts/fix-opera.action Normal file
View File

@@ -0,0 +1 @@
opera-stable:in:/root/scripts/fix-opera.sh