added sudo check, cleaned up comments

This commit is contained in:
2023-08-27 18:54:16 -05:00
parent c475c35795
commit 8fe2302ecc
13 changed files with 85 additions and 6 deletions

View File

@@ -1,5 +1,11 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then
echo "Please run as root"
exit
fi
# disable restart prompt for services during an update
if [[ ! -f /etc/needrestart/conf.d/no-prompt.conf ]] ; then
echo "\$nrconf{restart} = 'a';" >> /etc/needrestart/conf.d/no-prompt.conf

View File

@@ -1,5 +1,11 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then
echo "Please run as root"
exit
fi
if [[ ! -f /etc/apt/keyrings/docker.gpg ]]
then
apt-get update

View File

@@ -1,5 +1,11 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then
echo "Please run as root"
exit
fi
isInFile=$(cat /etc/samba/smb.conf | grep -c "akanealw")
if [ $isInFile -eq 0 ]
then

View File

@@ -1,6 +1,12 @@
#!/bin/bash
# ask to regenerate machine-id
if [ "$EUID" -ne 0 ]
then
echo "Please run as root"
exit
fi
# regenerate machine-id
if [[ ! -f /etc/machine-id-regenerated ]]
then
rm -f /etc/machine-id /var/lib/dbus/machine-id
@@ -12,7 +18,7 @@ if [[ ! -f /etc/machine-id-regenerated ]]
echo "Machine-id not regenerated."
fi
# ask to regenerate ssh host keys
# regenerate ssh host keys
if [[ ! -d /etc/cloud ]]
then
if [[ ! -f /home/akanealw/.ssh/ssh_keys_regenerated ]]

View File

@@ -1,5 +1,12 @@
# ask to set static ip address
#!/bin/bash
if [ "$EUID" -ne 0 ]
then
echo "Please run as root"
exit
fi
# set static ip address
if [[ ! -d /etc/cloud ]]
then
read -r -p "Enter Static IP Address with subnet prefix: " staticip