Skip to content

Commit 7929548

Browse files
authored
Possible Fixes for install issue
1 parent 1aaa30a commit 7929548

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

setup.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ fi
5555
# Install Required Packages for Script
5656
apt update --allow-releaseinfo-change -y
5757

58-
core_packages="apt bash boxes cron coreutils curl dos2unix git gzip nano openssl pwgen sed software-properties-common tar tzdata unattended-upgrades unzip zip"
58+
core_packages="apt bash boxes cron coreutils curl dos2unix git gzip nano needrestart openssl pwgen sed software-properties-common tar tzdata unattended-upgrades unzip zip"
5959

6060
apt install -qy $core_packages || {
6161
echo "Error: Unable to install one or more packages. Exiting..."
@@ -71,7 +71,10 @@ for cmd in "${required_commands[@]}"; do
7171
fi
7272
done
7373

74-
sed -i "s/#\$nrconf{restart} = 'i';/\$nrconf{restart} = 'a';/" /etc/needrestart/needrestart.conf
74+
# Configure needrestart if available
75+
if [[ -f "/etc/needrestart/needrestart.conf" ]]; then
76+
sed -i "s/#\$nrconf{restart} = 'i';/\$nrconf{restart} = 'a';/" /etc/needrestart/needrestart.conf
77+
fi
7578

7679
# Upgrade Software
7780
apt upgrade -y

0 commit comments

Comments
 (0)