Advertisement
Luticus

custom-install-fix

Sep 22nd, 2023 (edited)
878
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.62 KB | Gaming | 0 0
  1. #!/bin/bash
  2.  
  3. # Script by Joe McEntire
  4. # Check back at the pastebin link for updates
  5. # Pastebin:  https://pastebin.com/wAapiF4y
  6. # YouTube:   https://www.youtube.com/@JoeMcEntire
  7.  
  8. # safety stuff
  9. # set -o errexit
  10. set -o errtrace
  11. set -o noclobber
  12. set -o nounset
  13. set -o pipefail
  14.  
  15. # become root, if not root
  16. [ "$(id -u)" != 0 ] && exec sudo "$0"
  17.  
  18. # Check if root, bail if not
  19. if [[ $(whoami) != "root" ]]
  20. then
  21.     echo "Did not become root successfully."
  22.     exit
  23. fi
  24.  
  25. # disable readonly file system
  26. steamos-readonly disable
  27.  
  28. ####### Everything above this line is always required! #######
  29.  
  30.  
  31. ####### Firewalld Section (optional) #######
  32. # Enable firewalld with nftables backend
  33.  
  34. #check if firewalld is installed
  35. pacman -Qi firewalld > /dev/null
  36. if [ $? -eq 0 ]
  37. then
  38.     echo "Firewalld Installed, skipping."
  39. else
  40.     echo "Firewalld is not installed, cleaning up..."
  41.  
  42.     # remove files that will prevent pacman from reinstalling firewalld
  43.     rm /etc/firewall/applet.conf
  44.     rm /etc/firewalld/lockdown-whitelist.xml
  45.     rm /etc/logrotate.d/firewalld
  46.     rm /etc/modprobe.d/firewalld-sysctls.conf
  47.     rm /etc/xdg/autostart/firewall-applet.desktop
  48.  
  49.     # the --overwrite switch can also be used here but
  50.     # it's probably cleaner to remove the files in a
  51.     # targeted manner as above.
  52.     pacman -S --noconfirm firewalld nftables
  53.     echo "firewalld and nftables are installed."
  54. fi
  55.  
  56.  
  57. ####### Everything below this line is required #######
  58. # make filesystem read only again
  59. steamos-readonly enable
  60.  
  61. # hold terminal open until enter is pressed so results can be seen.
  62. read -p "Press Enter to continue" </dev/tty
  63.  
  64.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement