Update: sudoer for xremap.service

This commit is contained in:
Akemi Izuko 2023-01-08 15:40:57 -07:00
parent 230174ce1c
commit 6a3f9a9d08
No known key found for this signature in database
GPG key ID: 905D444F6A5E4BE4
2 changed files with 17 additions and 4 deletions

View file

@ -69,5 +69,5 @@ case "$(echo "$1" | awk '{print tolower($0)}')" in
;;
esac
systemctl restart xremap
sudo /usr/bin/systemctl restart xremap.service
sleep 2

View file

@ -145,6 +145,7 @@ xremap_checks() {
check_xremap_etc
check_xremap_executable
check_xremap_systemd
check_xremap_sudoer
}
check_xremap_config() {
@ -207,6 +208,18 @@ check_xremap_systemd() {
return $return_code
}
check_xremap_sudoer() {
local return_code=0
if ! sudo -l | grep -Eq 'NOPASSWD:[[:space:]]+/usr/bin/systemctl restart xremap.service'; then
printf "ERR: xremap.service not passwordless for sudoers\n"
printf "\t $ please echo \"%wheel ALL=NOPASSWD: /usr/bin/systemctl restart xremap.service\" >> /etc/sudoers.d/xremap\n"
return_code=1
fi
return $return_code
}
####################
# Browsers
####################
@ -300,9 +313,9 @@ check_vimiv_plugin() {
if ! [[ -e /usr/lib/qt/plugins/imageformats/libqavif.so ]]; then
printf "ERR: Missing avif support for vimiv\n"
cat <<HELP
$ curl -LO 'https://github.com/novomesk/qt-avif-image-plugin/archive/refs/tags/v0.5.0.tar.gz'
$ tar xf qt-avif-image-plugin-0.5.0.tar.gz
$ cd qt-avif-image-plugin-0.5.0
$ curl -LO 'https://github.com/novomesk/qt-avif-image-plugin/archive/refs/tags/v0.5.1.tar.gz'
$ tar xf qt-avif-image-plugin-0.5.1.tar.gz
$ cd qt-avif-image-plugin-0.5.1
$ ./build_libqavif_dynamic.sh
$ please make install
HELP