Ended friendship with doas
This commit is contained in:
parent
eae6adf1d5
commit
a7b9cb6d55
3 changed files with 8 additions and 21 deletions
|
@ -5,6 +5,6 @@ BatchInstall = true
|
|||
NewsOnUpgrade = true
|
||||
RemoveMake = yes
|
||||
|
||||
[bin]
|
||||
Sudo = doas
|
||||
SudoFlags = --
|
||||
#[bin]
|
||||
#Sudo = doas
|
||||
#SudoFlags = --
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue