Ended friendship with doas

This commit is contained in:
Tobias Reisinger 2021-07-13 02:05:40 +02:00
parent eae6adf1d5
commit a7b9cb6d55
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
3 changed files with 8 additions and 21 deletions

View file

@ -5,6 +5,6 @@ BatchInstall = true
NewsOnUpgrade = true
RemoveMake = yes
[bin]
Sudo = doas
SudoFlags = --
#[bin]
#Sudo = doas
#SudoFlags = --

View file

@ -1,12 +1,6 @@
#!/usr/bin/sh
alias get_priv="sudo"
if [ -x "$(command -v doas)" ]
then
alias get_priv="doas"
fi
get_priv echo
sudo echo
paru -Syu
@ -21,7 +15,7 @@ fi
echo "==================================================================="
get_priv checkservices
sudo checkservices
if [ $? -eq 0 ]; then
echo "CHECKSERVICES SUCCEDEED"

View file

@ -2,13 +2,6 @@
set -e
priv_cmd="sudo"
if [ -x "$(command -v doas)" ]
then
priv_cmd="doas --"
fi
edit_directory="$HOME/.cache/edit/"
filehash=$(readlink -fn "$1" | md5sum | awk '{ print $1 }')
@ -23,11 +16,11 @@ group=$(id -gn)
echo "Editing $1 in $filepath as $user:$group"
$priv_cmd cp "$1" "$filepath"
$priv_cmd chown $user:$group "$filepath"
sudo cp "$1" "$filepath"
sudo chown $user:$group "$filepath"
$EDITOR "$filepath"
$priv_cmd cp "$filepath" "$1"
sudo cp "$filepath" "$1"
rm "$filepath"