added /etc/.netig.conf to remember when config already applied
This commit is contained in:
@@ -4,6 +4,18 @@ echo
|
|||||||
echo " => Configuration"
|
echo " => Configuration"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
|
config_file="/etc/.netig.conf"
|
||||||
|
|
||||||
|
# Skip if already configured
|
||||||
|
if [ -f $config_file ]; then
|
||||||
|
source $config_file
|
||||||
|
if [ $config = done ]; then
|
||||||
|
echo "Configuration already applied !"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Server configuration
|
||||||
if [ $profile = server ]; then
|
if [ $profile = server ]; then
|
||||||
# Firewall basic configuration
|
# Firewall basic configuration
|
||||||
ufw default deny incoming
|
ufw default deny incoming
|
||||||
@@ -17,13 +29,13 @@ if [ $profile = server ]; then
|
|||||||
imaps
|
imaps
|
||||||
smtp
|
smtp
|
||||||
smtps"
|
smtps"
|
||||||
|
|
||||||
for i in $ports
|
for i in $ports
|
||||||
do
|
do
|
||||||
ufw allow $i
|
ufw allow $i
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Desktop configuration
|
||||||
if [ $profile = desktop ]; then
|
if [ $profile = desktop ]; then
|
||||||
# Firewall configuration
|
# Firewall configuration
|
||||||
ufw default deny incoming
|
ufw default deny incoming
|
||||||
@@ -32,3 +44,7 @@ if [ $profile = desktop ]; then
|
|||||||
# Disable all managed interfaces excerpt loopback from /etc/network/interfaces file to allow NetworkManager to manage them
|
# Disable all managed interfaces excerpt loopback from /etc/network/interfaces file to allow NetworkManager to manage them
|
||||||
sed -i '/# The primary network interface/Q' /etc/network/interfaces
|
sed -i '/# The primary network interface/Q' /etc/network/interfaces
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Remember configuration is applied
|
||||||
|
echo "config=done" > $config_file
|
||||||
|
chmod +x $config_file
|
||||||
|
|||||||
@@ -18,5 +18,5 @@ if [ $? -ne 0 ]; then
|
|||||||
tee /etc/apt/sources.list.d/docker.list > /dev/null
|
tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||||
apt-get update
|
apt-get update
|
||||||
# Install packages
|
# Install packages
|
||||||
apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
|
apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user