added sudo check, cleaned up comments
This commit is contained in:
6
debian/debian-essentials.sh
vendored
6
debian/debian-essentials.sh
vendored
@@ -1,5 +1,11 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [ "$EUID" -ne 0 ]
|
||||||
|
then
|
||||||
|
echo "Please run as root"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
# autoreply config update dialog with no
|
# autoreply config update dialog with no
|
||||||
if [[ ! -f /etc/apt/apt.conf.d/local ]]
|
if [[ ! -f /etc/apt/apt.conf.d/local ]]
|
||||||
then
|
then
|
||||||
|
|||||||
6
debian/debian-install-docker.sh
vendored
6
debian/debian-install-docker.sh
vendored
@@ -1,5 +1,11 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [ "$EUID" -ne 0 ]
|
||||||
|
then
|
||||||
|
echo "Please run as root"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ ! -f /etc/apt/keyrings/docker.gpg ]]
|
if [[ ! -f /etc/apt/keyrings/docker.gpg ]]
|
||||||
then
|
then
|
||||||
apt-get update
|
apt-get update
|
||||||
|
|||||||
6
debian/debian-install-samba.sh
vendored
6
debian/debian-install-samba.sh
vendored
@@ -1,5 +1,11 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [ "$EUID" -ne 0 ]
|
||||||
|
then
|
||||||
|
echo "Please run as root"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
isInFile=$(cat /etc/samba/smb.conf | grep -c "akanealw")
|
isInFile=$(cat /etc/samba/smb.conf | grep -c "akanealw")
|
||||||
if [ $isInFile -eq 0 ]
|
if [ $isInFile -eq 0 ]
|
||||||
then
|
then
|
||||||
|
|||||||
10
debian/debian-regenerate-ssh-keys-machine-id.sh
vendored
10
debian/debian-regenerate-ssh-keys-machine-id.sh
vendored
@@ -1,6 +1,12 @@
|
|||||||
#!/bin/bash
|
#!/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 ]]
|
if [[ ! -f /etc/machine-id-regenerated ]]
|
||||||
then
|
then
|
||||||
rm -f /etc/machine-id /var/lib/dbus/machine-id
|
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."
|
echo "Machine-id not regenerated."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ask to regenerate ssh host keys
|
# regenerate ssh host keys
|
||||||
if [[ ! -d /etc/cloud ]]
|
if [[ ! -d /etc/cloud ]]
|
||||||
then
|
then
|
||||||
if [[ ! -f /home/akanealw/.ssh/ssh_keys_regenerated ]]
|
if [[ ! -f /home/akanealw/.ssh/ssh_keys_regenerated ]]
|
||||||
|
|||||||
8
debian/debian-set-ip.sh
vendored
8
debian/debian-set-ip.sh
vendored
@@ -1,6 +1,12 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# ask to set static ip address
|
if [ "$EUID" -ne 0 ]
|
||||||
|
then
|
||||||
|
echo "Please run as root"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
# set static ip address
|
||||||
if [[ ! -d /etc/cloud ]]
|
if [[ ! -d /etc/cloud ]]
|
||||||
then
|
then
|
||||||
if [[ ! -f /etc/network/interfaces.bak ]]
|
if [[ ! -f /etc/network/interfaces.bak ]]
|
||||||
|
|||||||
6
debian/debian-setup-email.sh
vendored
6
debian/debian-setup-email.sh
vendored
@@ -1,5 +1,11 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [ "$EUID" -ne 0 ]
|
||||||
|
then
|
||||||
|
echo "Please run as root"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
isInFile=$(cat /etc/postfix/main.cf | grep -c "gmail")
|
isInFile=$(cat /etc/postfix/main.cf | grep -c "gmail")
|
||||||
if [ $isInFile -eq 0 ]
|
if [ $isInFile -eq 0 ]
|
||||||
then
|
then
|
||||||
|
|||||||
6
debian/debian-setup-unattended-upgrades.sh
vendored
6
debian/debian-setup-unattended-upgrades.sh
vendored
@@ -1,5 +1,11 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [ "$EUID" -ne 0 ]
|
||||||
|
then
|
||||||
|
echo "Please run as root"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
isInFile=$(cat /etc/apt/apt.conf.d/20auto-upgrades | grep -c 'APT::Periodic::Unattended-Upgrade "1";')
|
isInFile=$(cat /etc/apt/apt.conf.d/20auto-upgrades | grep -c 'APT::Periodic::Unattended-Upgrade "1";')
|
||||||
if [ $isInFile -eq 0 ]
|
if [ $isInFile -eq 0 ]
|
||||||
then
|
then
|
||||||
|
|||||||
6
debian/debian-update-sources.sh
vendored
6
debian/debian-update-sources.sh
vendored
@@ -1,5 +1,11 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [ "$EUID" -ne 0 ]
|
||||||
|
then
|
||||||
|
echo "Please run as root"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
# update bookworm to new debian.sources file
|
# update bookworm to new debian.sources file
|
||||||
if [[ -f /etc/apt/sources.list.d/debian.sources ]]
|
if [[ -f /etc/apt/sources.list.d/debian.sources ]]
|
||||||
then
|
then
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [ "$EUID" -ne 0 ]
|
||||||
|
then
|
||||||
|
echo "Please run as root"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
# disable restart prompt for services during an update
|
# disable restart prompt for services during an update
|
||||||
if [[ ! -f /etc/needrestart/conf.d/no-prompt.conf ]] ; then
|
if [[ ! -f /etc/needrestart/conf.d/no-prompt.conf ]] ; then
|
||||||
echo "\$nrconf{restart} = 'a';" >> /etc/needrestart/conf.d/no-prompt.conf
|
echo "\$nrconf{restart} = 'a';" >> /etc/needrestart/conf.d/no-prompt.conf
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [ "$EUID" -ne 0 ]
|
||||||
|
then
|
||||||
|
echo "Please run as root"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ ! -f /etc/apt/keyrings/docker.gpg ]]
|
if [[ ! -f /etc/apt/keyrings/docker.gpg ]]
|
||||||
then
|
then
|
||||||
apt-get update
|
apt-get update
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [ "$EUID" -ne 0 ]
|
||||||
|
then
|
||||||
|
echo "Please run as root"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
isInFile=$(cat /etc/samba/smb.conf | grep -c "akanealw")
|
isInFile=$(cat /etc/samba/smb.conf | grep -c "akanealw")
|
||||||
if [ $isInFile -eq 0 ]
|
if [ $isInFile -eq 0 ]
|
||||||
then
|
then
|
||||||
|
|||||||
@@ -1,6 +1,12 @@
|
|||||||
#!/bin/bash
|
#!/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 ]]
|
if [[ ! -f /etc/machine-id-regenerated ]]
|
||||||
then
|
then
|
||||||
rm -f /etc/machine-id /var/lib/dbus/machine-id
|
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."
|
echo "Machine-id not regenerated."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ask to regenerate ssh host keys
|
# regenerate ssh host keys
|
||||||
if [[ ! -d /etc/cloud ]]
|
if [[ ! -d /etc/cloud ]]
|
||||||
then
|
then
|
||||||
if [[ ! -f /home/akanealw/.ssh/ssh_keys_regenerated ]]
|
if [[ ! -f /home/akanealw/.ssh/ssh_keys_regenerated ]]
|
||||||
|
|||||||
@@ -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 ]]
|
if [[ ! -d /etc/cloud ]]
|
||||||
then
|
then
|
||||||
read -r -p "Enter Static IP Address with subnet prefix: " staticip
|
read -r -p "Enter Static IP Address with subnet prefix: " staticip
|
||||||
|
|||||||
Reference in New Issue
Block a user