Skip to content
Snippets Groups Projects
Commit 9024576f authored by Elian Loraux's avatar Elian Loraux
Browse files

add basename

parent f70eea5b
Branches
No related tags found
1 merge request!17Reorganisation
#!/bin/bash #!/bin/bash
echo "============= $(basename "$0") ================="
backup_system="" backup_system=""
duplicity_dir="/opt/duplicity-ftp-backup/" duplicity_dir="/opt/duplicity-ftp-backup/"
duplicity_alt_dir="/root/duplicity-ftp-backup/" duplicity_alt_dir="/root/duplicity-ftp-backup/"
......
#!/bin/bash #!/bin/bash
echo "============= $(basename "$0") ================="
# Check if reeboot is requird # Check if reeboot is requird
last_kernel="$(dpkg -l | awk '/linux-image-[0-9]/{print $2}' | sort -rn | head -n 1)" last_kernel="$(dpkg -l | awk '/linux-image-[0-9]/{print $2}' | sort -rn | head -n 1)"
running_kernel="linux-image-$(uname -r)" running_kernel="linux-image-$(uname -r)"
......
#!/bin/bash #!/bin/bash
echo "============= $(basename "$0") ================="
if [ "${WEB_SERVER}" == "apache2" ] if [ "${WEB_SERVER}" == "apache2" ]
then then
apache2ctl -S 2>/dev/null | awk '/namevhost/{print "https://"$4}' | sort -u | grep -v "127.0...1" apache2ctl -S 2>/dev/null | awk '/namevhost/{print "https://"$4}' | sort -u | grep -v "127.0...1"
...@@ -17,6 +20,3 @@ if id "dockerweb" >/dev/null 2>&1; then ...@@ -17,6 +20,3 @@ if id "dockerweb" >/dev/null 2>&1; then
echo "===== list of domain ====" echo "===== list of domain ===="
docker ps -qa | xargs docker inspect | awk '/traefik.http.routers.*.rule/{print $2}' | sed -e 's/^"Host(`//' -e 's/`)",//' -e 's/`,`/\n/g' | grep -v '!ClientIP' | sort -u docker ps -qa | xargs docker inspect | awk '/traefik.http.routers.*.rule/{print $2}' | sed -e 's/^"Host(`//' -e 's/`)",//' -e 's/`,`/\n/g' | grep -v '!ClientIP' | sort -u
fi fi
#!/bin/bash #!/bin/bash
Subject: test\n\nCeci est un test" | sendmail -t root echo "============= $(basename "$0") ================="
Subject: test\n\nCeci est un test" | sendmail -t root
#!/bin/bash #!/bin/bash
echo "============= $(basename "$0") ================="
# Check rootkits and antivirus # Check rootkits and antivirus
if [ `grep -c "^ALLOWHIDDENDIR=/etc/.java" /etc/rkhunter.conf` -eq 0 ] if [ `grep -c "^ALLOWHIDDENDIR=/etc/.java" /etc/rkhunter.conf` -eq 0 ]
then then
......
#!/bin/bash #!/bin/bash
echo "============= $(basename "$0") ================="
if [ ! -e $(pwd)/$(dirname "$0")/../main.env ] if [ ! -e $(pwd)/$(dirname "$0")/../main.env ]
then then
echo "Please copy in racine of NoCloud Auto Installer main.env.sample tomain.env and edit it" echo "Please copy in racine of NoCloud Auto Installer main.env.sample to ain.env and edit it"
exit 1 exit 1
fi fi
. $(pwd)/$(dirname "$0")/../main.env . $(pwd)/$(dirname "$0")/../main.env
......
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
set -o nounset # Treat unset variables as an error set -o nounset # Treat unset variables as an error
echo "============= $(basename "$0") ================="
if [ ! -e $(pwd)/$(dirname "$0")/../main.env ] if [ ! -e $(pwd)/$(dirname "$0")/../main.env ]
then then
echo "Please copy in racine of NoCloud Auto Installer main.env.sample to main.env and edit it" echo "Please copy in racine of NoCloud Auto Installer main.env.sample to main.env and edit it"
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
# You should have received a copy of the GNU General Public License # along # You should have received a copy of the GNU General Public License # along
# with this program. If not, see <http://www.gnu.org/licenses/>. # with this program. If not, see <http://www.gnu.org/licenses/>.
echo "============= $(basename "$0") ================="
if [ ! -e $(pwd)/$(dirname "$0")/../main.env ] if [ ! -e $(pwd)/$(dirname "$0")/../main.env ]
then then
......
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
set -o nounset # Treat unset variables as an error set -o nounset # Treat unset variables as an error
echo "============= $(basename "$0") ================="
if [ ! -e $(pwd)/$(dirname "$0")/../main.env ] if [ ! -e $(pwd)/$(dirname "$0")/../main.env ]
then then
echo "Please copy in racine of NoCloud Auto Installer main.env.sample to main.env and edit it" echo "Please copy in racine of NoCloud Auto Installer main.env.sample to main.env and edit it"
......
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
set -o nounset # Treat unset variables as an error set -o nounset # Treat unset variables as an error
echo "============= $(basename "$0") ================="
if [ ! -e $(pwd)/$(dirname "$0")/../main.env ] if [ ! -e $(pwd)/$(dirname "$0")/../main.env ]
then then
echo "Please copy in racine of NoCloud Auto Installer main.env.sample to main.env and edit it" echo "Please copy in racine of NoCloud Auto Installer main.env.sample to main.env and edit it"
......
#!/bin/bash #!/bin/bash
echo "============= $(basename "$0") ================="
cd /tmp cd /tmp
wget -O glpi.deb https://github.com/glpi-project/glpi-agent/releases/download/1.4/glpi-agent_1.4-1_all.deb wget -O glpi.deb https://github.com/glpi-project/glpi-agent/releases/download/1.4/glpi-agent_1.4-1_all.deb
dpkg -i glpi.deb dpkg -i glpi.deb
......
#!/bin/bash #!/bin/bash
echo "============= $(basename "$0") ================="
if [ ! -e $(pwd)/$(dirname "$0")/../main.env ] if [ ! -e $(pwd)/$(dirname "$0")/../main.env ]
then then
echo "Please copy in racine of NoCloud Auto Installer main.env.sample to main.env and edit it" echo "Please copy in racine of NoCloud Auto Installer main.env.sample to main.env and edit it"
......
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
set -o nounset # Treat unset variables as an error set -o nounset # Treat unset variables as an error
echo "============= $(basename "$0") ================="
if [ ! -e $(pwd)/$(dirname "$0")/../main.env ] if [ ! -e $(pwd)/$(dirname "$0")/../main.env ]
then then
echo "Please copy in racine of NoCloud Auto Installer main.env.sample to main.env and edit it" echo "Please copy in racine of NoCloud Auto Installer main.env.sample to main.env and edit it"
......
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
set -o nounset # Treat unset variables as an error set -o nounset # Treat unset variables as an error
echo "============= $(basename "$0") ================="
if [ ! -e $(pwd)/$(dirname "$0")/../main.env ] if [ ! -e $(pwd)/$(dirname "$0")/../main.env ]
then then
echo "Please copy in racine of NoCloud Auto Installer main.env.sample to main.env and edit it" echo "Please copy in racine of NoCloud Auto Installer main.env.sample to main.env and edit it"
......
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
echo "============= $(basename "$0") ================="
NEXTCLOUD_INSTALL_DIR="/var/www/nextcloud/" NEXTCLOUD_INSTALL_DIR="/var/www/nextcloud/"
APPS="tasks news talk calendar contacts impersonate" APPS="tasks news talk calendar contacts impersonate"
......
#!/bin/bash #!/bin/bash
echo "============= $(basename "$0") ================="
if [ ! -e $(pwd)/$(dirname "$0")/../main.env ] if [ ! -e $(pwd)/$(dirname "$0")/../main.env ]
then then
echo "Please copy in racine of NoCloud Auto Installer main.env.sample to main.env and edit it" echo "Please copy in racine of NoCloud Auto Installer main.env.sample to main.env and edit it"
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
# You should have received a copy of the GNU General Public License # along # You should have received a copy of the GNU General Public License # along
# with this program. If not, see <http://www.gnu.org/licenses/>. # with this program. If not, see <http://www.gnu.org/licenses/>.
echo "============= $(basename "$0") ================="
TB_CONFIG_ServerName=${TB_CONFIG_ServerName:-tetras-back.${DOMAIN}} TB_CONFIG_ServerName=${TB_CONFIG_ServerName:-tetras-back.${DOMAIN}}
TB_CONFIG_ServerAdmin=${TB_CONFIG_ServerAdmin:-${SERVER_ADMIN}} TB_CONFIG_ServerAdmin=${TB_CONFIG_ServerAdmin:-${SERVER_ADMIN}}
......
#!/bin/bash #!/bin/bash
echo "============= $(basename "$0") ================="
if [ ! -e $(pwd)/$(dirname "$0")/../main.env ] if [ ! -e $(pwd)/$(dirname "$0")/../main.env ]
then then
echo "Please copy in racine of NoCloud Auto Installer main.env.sample to main.env and edit it" echo "Please copy in racine of NoCloud Auto Installer main.env.sample to main.env and edit it"
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
set -o nounset # Treat unset variables as an error set -o nounset # Treat unset variables as an error
apt-get update echo "============= $(basename "$0") ================="
if [ ! -e $(pwd)/$(dirname "$0")/../main.env ] if [ ! -e $(pwd)/$(dirname "$0")/../main.env ]
then then
...@@ -27,6 +27,8 @@ then ...@@ -27,6 +27,8 @@ then
fi fi
. $(pwd)/$(dirname "$0")/../main.env . $(pwd)/$(dirname "$0")/../main.env
apt-get update
if [ "${WEB_SERVER}" == "apache2" ] if [ "${WEB_SERVER}" == "apache2" ]
then then
export WEB_SERVER_PACKAGES="apache2" export WEB_SERVER_PACKAGES="apache2"
......
#!/bin/bash #!/bin/bash
echo "============= $(basename "$0") ================="
# Install ncdu for disk usage analysis # Install ncdu for disk usage analysis
if [ -z "$(dpkg -l | grep ncdu)" ]; then if [ -z "$(dpkg -l | grep ncdu)" ]; then
apt-get update && apt-get install -y ncdu apt-get update && apt-get install -y ncdu
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment