From 63227ef4e34a0e084cfeb89584b89e7601906ae0 Mon Sep 17 00:00:00 2001 From: Xavier Petit <32063953+xpetit@users.noreply.github.com> Date: Fri, 11 Oct 2019 11:42:59 +0200 Subject: [PATCH] Modify shebang & lowercase variable --- scripts/bash_tweaks.sh | 6 +++--- scripts/clean.sh | 6 +++--- scripts/firewall.sh | 6 +++--- scripts/fx.sh | 6 +++--- scripts/go.sh | 6 +++--- scripts/grub.sh | 6 +++--- scripts/install_client.sh | 8 ++++---- scripts/libreoffice.sh | 6 +++--- scripts/nodejs.sh | 6 +++--- scripts/set.sh | 2 +- scripts/ssh.sh | 6 +++--- scripts/sublime.sh | 6 +++--- scripts/system/etc/gdm3/PostLogin/Default | 2 +- scripts/system/etc/gdm3/PostSession/Default | 2 +- scripts/system/usr/local/bin/lock_screen | 2 +- scripts/system/usr/local/bin/suspend_session | 2 +- scripts/ubuntu_tweaks.sh | 6 +++--- scripts/vscode.sh | 6 +++--- 18 files changed, 45 insertions(+), 45 deletions(-) diff --git a/scripts/bash_tweaks.sh b/scripts/bash_tweaks.sh index fe1776d3..76446774 100755 --- a/scripts/bash_tweaks.sh +++ b/scripts/bash_tweaks.sh @@ -1,9 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash # Configure Terminal -SCRIPT_DIR="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)" -cd $SCRIPT_DIR +script_dir="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)" +cd $script_dir . set.sh # Makes bash case-insensitive diff --git a/scripts/clean.sh b/scripts/clean.sh index 21a0834f..6c23d45d 100755 --- a/scripts/clean.sh +++ b/scripts/clean.sh @@ -1,9 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash # Clean system -SCRIPT_DIR="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)" -cd $SCRIPT_DIR +script_dir="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)" +cd $script_dir . set.sh # Purge useless packages diff --git a/scripts/firewall.sh b/scripts/firewall.sh index 78f1f66e..93c7f78b 100755 --- a/scripts/firewall.sh +++ b/scripts/firewall.sh @@ -1,9 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash # Install firewall -SCRIPT_DIR="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)" -cd $SCRIPT_DIR +script_dir="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)" +cd $script_dir . set.sh SSH_PORT=${1:-521} diff --git a/scripts/fx.sh b/scripts/fx.sh index 07f724c2..9a8469fc 100755 --- a/scripts/fx.sh +++ b/scripts/fx.sh @@ -1,9 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash # Install FX: command-line JSON processing tool (https://github.com/antonmedv/fx) -SCRIPT_DIR="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)" -cd $SCRIPT_DIR +script_dir="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)" +cd $script_dir . set.sh npm install -g fx diff --git a/scripts/go.sh b/scripts/go.sh index 0fafed82..9acaaeb6 100755 --- a/scripts/go.sh +++ b/scripts/go.sh @@ -1,9 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash # Install Go -SCRIPT_DIR="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)" -cd $SCRIPT_DIR +script_dir="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)" +cd $script_dir . set.sh apt-get -y install golang diff --git a/scripts/grub.sh b/scripts/grub.sh index 502f8e43..1eb0bb1e 100755 --- a/scripts/grub.sh +++ b/scripts/grub.sh @@ -1,9 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash # Install Grub -SCRIPT_DIR="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)" -cd $SCRIPT_DIR +script_dir="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)" +cd $script_dir . set.sh DISK=$1 diff --git a/scripts/install_client.sh b/scripts/install_client.sh index b36df9a3..01f6883e 100755 --- a/scripts/install_client.sh +++ b/scripts/install_client.sh @@ -1,12 +1,12 @@ -#!/bin/bash +#!/usr/bin/env bash # Configure Z01 client # Log stdout & stderr exec > >(tee -i /tmp/install_client.log) 2>&1 -SCRIPT_DIR="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)" -cd $SCRIPT_DIR +script_dir="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)" +cd $script_dir . set.sh SSH_PORT=521 @@ -99,7 +99,7 @@ cd /tmp/system cp --preserve=mode -RT . / -cd $SCRIPT_DIR +cd $script_dir rm -rf /tmp/system apt-get -y install overlayroot diff --git a/scripts/libreoffice.sh b/scripts/libreoffice.sh index 6d39a352..0a7cd9e0 100755 --- a/scripts/libreoffice.sh +++ b/scripts/libreoffice.sh @@ -1,9 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash # Install VSCode -SCRIPT_DIR="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)" -cd $SCRIPT_DIR +script_dir="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)" +cd $script_dir . set.sh apt-get -y install libreoffice diff --git a/scripts/nodejs.sh b/scripts/nodejs.sh index 9aa678e3..565e6816 100755 --- a/scripts/nodejs.sh +++ b/scripts/nodejs.sh @@ -1,9 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash # Install Node.js -SCRIPT_DIR="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)" -cd $SCRIPT_DIR +script_dir="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)" +cd $script_dir . set.sh curl -sL https://deb.nodesource.com/setup_12.x | bash - diff --git a/scripts/set.sh b/scripts/set.sh index 690e3018..db29970d 100755 --- a/scripts/set.sh +++ b/scripts/set.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Set scripting variables diff --git a/scripts/ssh.sh b/scripts/ssh.sh index e0f8a1b5..cd754ef6 100755 --- a/scripts/ssh.sh +++ b/scripts/ssh.sh @@ -1,9 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash # Install OpenSSH -SCRIPT_DIR="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)" -cd $SCRIPT_DIR +script_dir="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)" +cd $script_dir . set.sh SSH_PORT=${1:-521} diff --git a/scripts/sublime.sh b/scripts/sublime.sh index b79ee4b1..f0382157 100755 --- a/scripts/sublime.sh +++ b/scripts/sublime.sh @@ -1,9 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash # Install Sublime Text & Sublime Merge -SCRIPT_DIR="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)" -cd $SCRIPT_DIR +script_dir="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)" +cd $script_dir . set.sh wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | apt-key add - diff --git a/scripts/system/etc/gdm3/PostLogin/Default b/scripts/system/etc/gdm3/PostLogin/Default index e2acb90f..b2a73250 100755 --- a/scripts/system/etc/gdm3/PostLogin/Default +++ b/scripts/system/etc/gdm3/PostLogin/Default @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Mount home as an overlay filesystem diff --git a/scripts/system/etc/gdm3/PostSession/Default b/scripts/system/etc/gdm3/PostSession/Default index 21aba95d..2b041c42 100755 --- a/scripts/system/etc/gdm3/PostSession/Default +++ b/scripts/system/etc/gdm3/PostSession/Default @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Log stdout & stderr exec > >(tee -i /tmp/gdm3_postsession.log) 2>&1 diff --git a/scripts/system/usr/local/bin/lock_screen b/scripts/system/usr/local/bin/lock_screen index d4f63f24..353cf90e 100755 --- a/scripts/system/usr/local/bin/lock_screen +++ b/scripts/system/usr/local/bin/lock_screen @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Exits if a command fails set -e diff --git a/scripts/system/usr/local/bin/suspend_session b/scripts/system/usr/local/bin/suspend_session index 021e8bf1..34b6c277 100755 --- a/scripts/system/usr/local/bin/suspend_session +++ b/scripts/system/usr/local/bin/suspend_session @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Exits if a command fails set -e diff --git a/scripts/ubuntu_tweaks.sh b/scripts/ubuntu_tweaks.sh index 2209d28a..dc7e2f8d 100755 --- a/scripts/ubuntu_tweaks.sh +++ b/scripts/ubuntu_tweaks.sh @@ -1,9 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash # Configure ubuntu desktop systems -SCRIPT_DIR="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)" -cd "$SCRIPT_DIR" +script_dir="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)" +cd "$script_dir" . set.sh # Install dependencies diff --git a/scripts/vscode.sh b/scripts/vscode.sh index 941a7dc1..359f6429 100755 --- a/scripts/vscode.sh +++ b/scripts/vscode.sh @@ -1,9 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash # Install VSCode -SCRIPT_DIR="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)" -cd $SCRIPT_DIR +script_dir="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)" +cd $script_dir . set.sh wget -qO - https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/master/pub.gpg | apt-key add -