add guard clause to enforce sudo user
This commit is contained in:
parent
d7c4c9e63b
commit
488b05e827
12
install.sh
12
install.sh
@ -1,9 +1,17 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# TODO should be applicable to other package managers (dnf, apt, ..)
|
# TODO should be applicable to other package managers (dnf, apt, ..)
|
||||||
|
# v--- this is for potential future ideas
|
||||||
|
# flatpak uninstall $(flatpak list --columns=application | grep -i turtle)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
main(){
|
main(){
|
||||||
|
if [[ "$(whoami)" != "root" ]];then
|
||||||
|
bash ./error.sh "Must be root (current: $USER)";
|
||||||
|
exit 1;
|
||||||
|
fi
|
||||||
|
|
||||||
_update_pac
|
_update_pac
|
||||||
bash ./dots.sh;
|
bash ./dots.sh;
|
||||||
bash ./cli.sh;
|
bash ./cli.sh;
|
||||||
@ -13,8 +21,8 @@ main(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
_update_pac(){
|
_update_pac(){
|
||||||
sudo pacman -Fy --noconfirm
|
pacman -Fy --noconfirm
|
||||||
sudo pacman -Syu --noconfirm
|
pacman -Syu --noconfirm
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user