if [ "$1" ]; then
case $1 in
"install") echo "Installation $(basename $0) addon...";
- if [ ! -d /usr/share/immudex-addons ]; then
- mkdir /usr/share/immudex-addons;
+ if [ ! -d /boot ]; then
+ mkdir /boot;
+ apt purge linux-image* --purge -y;
+ apt install linux-image-amd64;
fi
- cat >> $(basename $0)_installer << EOF
-if [ ! -d /boot ]; then
- mkdir /boot;
- apt purge linux-image* --purge -y;
- apt install linux-image-amd64;
-fi
-cp -vv /etc/apt/sources.list /etc/apt/sources.list.d/baytrail-sound.list;
-sed -e 's/main/contrib non-free non-free-firmware/g' -i /etc/apt/sources.list.d/baytrail-sound.list;
+ cp -vv /etc/apt/sources.list /etc/apt/sources.list.d/baytrail-sound.list;
+ sed -e 's/main/contrib non-free non-free-firmware/g' -i /etc/apt/sources.list.d/baytrail-sound.list;
-apt update;
-apt install firmware-sof-signed firmware-intel-sound;
+ apt update;
+ apt install firmware-sof-signed firmware-intel-sound;
+ if [ $? -eq 0 ]; then success=0; else success=1; fi
+ rm /etc/apt/sources.list.d/baytrail-sound.list;
+ apt update;
-rm /etc/apt/sources.list.d/baytrail-sound.list;
-apt update;
+ apt-get autoclean;
+ apt-get autoremove;
+ apt-get clean;
+ apt-get clean;
-apt-get autoclean;
-apt-get autoremove;
-apt-get clean;
-apt-get clean;
-EOF
- bash $(basename $0)_installer;
- if [ $? -eq 0 ]; then
- rm $(basename $0)_installer;
- echo $(basename $0) | tee -a /usr/share/immudex-addons/installed-addons;
+ if [ $success -eq 0 ]; then
echo "Installation $(basename $0) addon...[ OK ]";
fi;;
"remove") echo "Removing $(basename $0) addon...";
- cat >> $(basename $0)_uninstaller << EOF
-apt remove -y firmware-sof-signed firmware-intel-sound;
-apt-get autoclean;
-apt-get autoremove -y;
-apt-get clean;
-EOF
- bash $(basename $0)_uninstaller;
- if [ $? -eq 0 ]; then
- rm $(basename $0)_uninstaller;
- sed -i "s/$(basename $0)//g" /usr/share/immudex-addons/installed-addons;
+ apt remove -y firmware-sof-signed firmware-intel-sound;
+ if [ $? -eq 0 ]; then success=0; else success=1; fi
+ apt-get autoclean;
+ apt-get autoremove -y;
+ apt-get clean;
+ if [ $success -eq 0 ]; then
echo "Removing $(basename $0) addon...[ OK ]";
fi;;
esac
if [ "$1" ]; then
case $1 in
"install") echo "Installation $(basename $0) addon...";
- if [ ! -d /usr/share/immudex-addons ]; then
- mkdir /usr/share/immudex-addons;
+ if [ ! -d /boot ]; then
+ mkdir /boot;
+ apt purge linux-image* --purge -y;
+ apt install linux-image-amd64;
fi
- cat >> $(basename $0)_installer << EOF
-if [ ! -d /boot ]; then
- mkdir /boot;
- apt purge linux-image* --purge -y;
- apt install linux-image-amd64;
-fi
-
-cp -vv /etc/apt/sources.list /etc/apt/sources.list.d/iwlwifi.list;
-sed -e 's/main/contrib non-free non-free-firmware/g' -i /etc/apt/sources.list.d/iwlwifi.list;
-apt update;
-apt install firmware-iwlwifi;
+ cp -vv /etc/apt/sources.list /etc/apt/sources.list.d/iwlwifi.list;
+ sed -e 's/main/contrib non-free non-free-firmware/g' -i /etc/apt/sources.list.d/iwlwifi.list;
-rm /etc/apt/sources.list.d/iwlwifi.list;
-apt update;
+ apt update;
+ apt install firmware-iwlwifi;
+ if [ $? -eq 0 ]; then success=0; else succes=1; fi
+ rm /etc/apt/sources.list.d/iwlwifi.list;
+ apt update;
-apt-get autoclean;
-apt-get autoremove;
-apt-get clean;
-apt-get clean;
-EOF
- bash $(basename $0)_installer;
- if [ $? -eq 0 ]; then
- rm $(basename $0)_installer;
- echo $(basename $0) | tee -a /usr/share/immudex-addons/installed-addons;
+ apt-get autoclean;
+ apt-get autoremove;
+ apt-get clean;
+ apt-get clean;
+ if [ $success -eq 0 ]; then
echo "Installation $(basename $0) addon...[ OK ]";
fi;;
"remove") echo "Removing $(basename $0) addon...";
- cat >> $(basename $0)_uninstaller << EOF
-apt remove -y firmware-iwlwifi;
-apt-get autoclean;
-apt-get autoremove -y;
-apt-get clean;
-EOF
- bash $(basename $0)_uninstaller;
- if [ $? -eq 0 ]; then
- rm $(basename $0)_uninstaller;
- sed -i "s/$(basename $0)//g" /usr/share/immudex-addons/installed-addons;
+ apt remove -y firmware-iwlwifi;
+ if [ $? -eq 0 ]; then success=0; else success=1; fi
+ apt-get autoclean;
+ apt-get autoremove -y;
+ apt-get clean;
+
+ if [ $success -eq 0 ]; then
echo "Removing $(basename $0) addon...[ OK ]";
fi;;
esac
if [ "$1" ]; then
case $1 in
"install") echo "Installation $(basename $0) addon...";
- if [ ! -d /usr/share/immudex-addons ]; then
- mkdir /usr/share/immudex-addons;
- fi
- cat >> $(basename $0)_installer << EOF
-baseVersion=\$(head -1 /etc/apt/sources.list | awk '{print \$3}')
-
-apt install lsb-release;
-wget https://dev.mysql.com/get/mysql-apt-config_0.8.25-1_all.deb;
-dpkg -i mysql-apt-config_0.8.25-1_all.deb;
-
-sed -i "s/\$baseVersion/bullseye/g" /etc/apt/sources.list;
-
-apt update;
-apt install mysql-server -y
-apt-get install --fix-missing
-
-apt-mark hold libmecab2 libssl1.1 mecab-ipadic mecab-ipadic-utf8 mecab-utils mysql-client mysql-common mysql-community-client mysql-community-client-core mysql-community-client-plugins mysql-community-server mysql-community-server-core
-
-sed -i "s/bullseye/\$baseVersion/g" /etc/apt/sources.list;
-apt update
-apt install apache2 libapache2-mod-php php php-mysql -y;
-
-apt autoremove;
-apt autoclean;
-apt clean;
-apt clean;
-
-rm mysql-apt-config_0.8.25-1_all.deb;
-EOF
- bash $(basename $0)_installer;
- if [ $? -eq 0 ]; then
- rm $(basename $0)_installer;
- echo $(basename $0) | tee -a /usr/share/immudex-addons/installed-addons;
+ baseVersion=$(head -1 /etc/apt/sources.list | awk '{print $3}')
+
+ apt install lsb-release -y;
+ wget https://dev.mysql.com/get/mysql-apt-config_0.8.25-1_all.deb;
+ dpkg -i mysql-apt-config_0.8.25-1_all.deb;
+
+ sed -i "s/$baseVersion/bullseye/g" /etc/apt/sources.list;
+
+ apt update;
+ apt install mysql-server -y
+ apt-get install --fix-missing
+ if [ $? -eq 0 ]; then mysqlSuccess=0; else mysqlSuccess=1; fi
+
+ apt-mark hold libmecab2 libssl1.1 mecab-ipadic mecab-ipadic-utf8 mecab-utils mysql-client mysql-common mysql-community-client mysql-community-client-core mysql-community-client-plugins mysql-community-server mysql-community-server-core
+
+ sed -i "s/bullseye/$baseVersion/g" /etc/apt/sources.list;
+ apt update
+ apt install apache2 libapache2-mod-php php php-mysql -y;
+ if [ $? -eq 0 ]; then phpApacheSucces=0; else phpApacheSuccess=1; fi
+ apt autoremove;
+ apt autoclean;
+ apt clean;
+ apt clean;
+
+ rm mysql-apt-config_0.8.25-1_all.deb;
+ if [ $((mysqlSuccess * phpApacheSuccess)) -eq 0 ]; then
echo "Installation $(basename $0) addon...[ OK ]";
fi;;
"remove") echo "Removing $(basename $0) addon...";
- cat >> $(basename $0)_uninstaller << EOF
-apt-mark unhold libmecab2 libssl1.1 mecab-ipadic mecab-ipadic-utf8 mecab-utils mysql-client mysql-common mysql-community-client mysql-community-client-core mysql-community-client-plugins mysql-community-server mysql-community-server-core
-
-apt-get remove -y libssl1.1 mysql-client mysql-common mysql-community-client mysql-community-client-core mysql-community-client-plugins mysql-community-server mysql-community-server-core apache2 libapache2-mod-php php php-mysql mysql-apt-config
+ apt-mark unhold libmecab2 libssl1.1 mecab-ipadic mecab-ipadic-utf8 mecab-utils mysql-client mysql-common mysql-community-client mysql-community-client-core mysql-community-client-plugins mysql-community-server mysql-community-server-core
-apt-get upgrade -y libmecab2 mecab-utils mecab-ipadic mecab-ipadic-utf8;
+ apt-get remove -y libssl1.1 mysql-client mysql-common mysql-community-client mysql-community-client-core mysql-community-client-plugins mysql-community-server mysql-community-server-core apache2 libapache2-mod-php php php-mysql mysql-apt-config
+ if [ $? -eq 0 ]; then success=0; else success=1; fi
+ apt-get upgrade -y libmecab2 mecab-utils mecab-ipadic mecab-ipadic-utf8;
-apt-get autoclean
-apt-get autoremove -y
-apt-get clean
-EOF
- bash $(basename $0)_uninstaller;
- if [ $? -eq 0 ]; then
- rm $(basename $0)_uninstaller;
- sed -i "s/$(basename $0)//g" /usr/share/immudex-addons/installed-addons;
+ apt-get autoclean
+ apt-get autoremove -y
+ apt-get clean
+ if [ $success -eq 0 ]; then
echo "Removing $(basename $0) addon...[ OK ]";
fi;;
esac
if [ "$1" ]; then
case $1 in
"install") echo "Installation $(basename $0) addon...";
- if [ ! -d /usr/share/immudex-addons ]; then
- mkdir /usr/share/immudex-addons;
+ if [ ! -f /proc/cpuinfo ]; then
+ echo "There is no system interfaces! Nothing to do. Exiting...";
+ exit 1;
+ else
+ if [ ! -d /boot ]; then
+ mkdir /boot;
+ apt purge linux-image* --purge -y;
+ apt install linux-image-amd64 -y;
fi
- cat >> $(basename $0)_installer << EOF
-if [ ! -f /proc/cpuinfo ]; then
-echo "There is no system interfaces! Nothing to do. Exiting...";
-rm \$0;
-exit 1;
-else
-if [ ! -d /boot ]; then
- mkdir /boot;
- apt purge linux-image* --purge -y;
- apt install linux-image-amd64 -y;
-fi
-cp -vv /etc/apt/sources.list /etc/apt/sources.list.d/nvidia.list;
-sed -e 's/main/contrib non-free non-free-firmware/g' -i /etc/apt/sources.list.d/nvidia.list;
-apt update;
-apt install -y build-essential dkms linux-headers-\$(uname -r);
-apt install -y nvidia-detect;
-apt install -y nvidia-driver;
-fi
-EOF
- bash $(basename $0)_installer;
- if [ $? -eq 0 ]; then
- rm $(basename $0)_installer;
- echo $(basename $0) | sudo tee -a /usr/share/immudex-addons/installed-addons;
+ cp -vv /etc/apt/sources.list /etc/apt/sources.list.d/nvidia.list;
+ sed -e 's/main/contrib non-free non-free-firmware/g' -i /etc/apt/sources.list.d/nvidia.list;
+ apt update;
+ apt install -y build-essential dkms linux-headers-\$(uname -r);
+ apt install -y nvidia-detect;
+ apt install -y nvidia-driver;
+ if [ $? -eq 0 ]; then success=0; else; success=1; fi
+ fi
+ if [ $success -eq 0 ]; then
echo "Installation $(basename $0) addon...[ OK ]";
fi;;
"remove") echo "Removing $(basename $0) addon...";
- cat >> $(basename $0)_uninstaller << EOF
-apt remove -y nvidia-driver nvidia-detect dkms linux-headers-\$(uname -r);
-apt purge -y nvidia-*;
-rm /etc/apt/sources.list.d/nvidia.list;
-apt update;
-apt-get autoremove -y;
-apt-get autoclean;
-apt-get clean;
-EOF
- bash $(basename $0)_uninstaller;
- if [ $? -eq 0 ]; then
- rm $(basename $0)_uninstaller;
- sed -i "s/$(basename $0)//g" /usr/share/immudexi-addons/installed-addons;
+ apt remove -y nvidia-driver nvidia-detect dkms linux-headers-\$(uname -r);
+ apt purge -y nvidia-*;
+ if [ $? -eq 0 ]; then success=0; else success=1; fi
+ rm /etc/apt/sources.list.d/nvidia.list;
+ apt update;
+ apt-get autoremove -y;
+ apt-get autoclean;
+ apt-get clean;
+ if [ $success -eq 0 ]; then
echo "Removing $(basename $0) addon...[ OK ]";
fi;;
esac