mirror of
https://github.com/ChrisTitusTech/linutil.git
synced 2024-11-05 21:28:48 +00:00
Refactor sudo
This commit is contained in:
parent
9e2c29132b
commit
d56362276f
|
@ -8,10 +8,10 @@ setupBluetooth() {
|
|||
if ! command_exists bluetoothctl; then
|
||||
case ${PACKAGER} in
|
||||
pacman)
|
||||
sudo "${PACKAGER}" -S --noconfirm bluez-utils
|
||||
$ESCALATION_TOOL "${PACKAGER}" -S --noconfirm bluez-utils
|
||||
;;
|
||||
*)
|
||||
sudo "${PACKAGER}" install -y bluez
|
||||
$ESCALATION_TOOL "${PACKAGER}" install -y bluez
|
||||
;;
|
||||
esac
|
||||
else
|
||||
|
@ -21,7 +21,7 @@ setupBluetooth() {
|
|||
# Check if bluetooth service is running
|
||||
if ! systemctl is-active --quiet bluetooth; then
|
||||
echo "Bluetooth service is not running. Starting it now..."
|
||||
sudo systemctl start bluetooth
|
||||
$ESCALATION_TOOL systemctl start bluetooth
|
||||
|
||||
if systemctl is-active --quiet bluetooth; then
|
||||
echo "bluetooth service started successfully."
|
||||
|
|
|
@ -8,13 +8,13 @@ setup_xrandr() {
|
|||
if ! command_exists xrandr; then
|
||||
case ${PACKAGER} in
|
||||
pacman)
|
||||
sudo "${PACKAGER}" -S --noconfirm xorg-xrandr
|
||||
$ESCALATION_TOOL "${PACKAGER}" -S --noconfirm xorg-xrandr
|
||||
;;
|
||||
apt-get)
|
||||
sudo "${PACKAGER}" install -y x11-xserver-utils
|
||||
$ESCALATION_TOOL "${PACKAGER}" install -y x11-xserver-utils
|
||||
;;
|
||||
*)
|
||||
sudo "${PACKAGER}" install -y xorg-x11-server-utils
|
||||
$ESCALATION_TOOL "${PACKAGER}" install -y xorg-x11-server-utils
|
||||
;;
|
||||
esac
|
||||
else
|
||||
|
|
|
@ -8,13 +8,13 @@ setupNetworkManager() {
|
|||
if ! command_exists nmcli; then
|
||||
case ${PACKAGER} in
|
||||
pacman)
|
||||
sudo "${PACKAGER}" -S --noconfirm networkmanager
|
||||
$ESCALATION_TOOL "${PACKAGER}" -S --noconfirm networkmanager
|
||||
;;
|
||||
dnf)
|
||||
sudo "${PACKAGER}" install -y NetworkManager-1
|
||||
$ESCALATION_TOOL "${PACKAGER}" install -y NetworkManager-1
|
||||
;;
|
||||
*)
|
||||
sudo "${PACKAGER}" install -y network-manager
|
||||
$ESCALATION_TOOL "${PACKAGER}" install -y network-manager
|
||||
;;
|
||||
esac
|
||||
else
|
||||
|
@ -24,7 +24,7 @@ setupNetworkManager() {
|
|||
# Check if NetworkManager service is running
|
||||
if ! systemctl is-active --quiet NetworkManager; then
|
||||
echo "NetworkManager service is not running. Starting it now..."
|
||||
sudo systemctl start NetworkManager
|
||||
$ESCALATION_TOOL systemctl start NetworkManager
|
||||
|
||||
if systemctl is-active --quiet NetworkManager; then
|
||||
echo "NetworkManager service started successfully."
|
||||
|
|
Loading…
Reference in New Issue
Block a user