diff options
author | EuAndreh <eu@euandre.org> | 2019-01-03 06:12:39 -0200 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2019-01-03 06:42:41 -0200 |
commit | b679e7d91f7af2d97bead966a17b715cdb020b1a (patch) | |
tree | 71926893088a93513971d950d5a19b012722fedf /scripts | |
parent | Add custom nu gitconfig options in nugitconfig.ini file. (diff) | |
download | dotfiles-b679e7d91f7af2d97bead966a17b715cdb020b1a.tar.gz dotfiles-b679e7d91f7af2d97bead966a17b715cdb020b1a.tar.xz |
Fix shellcheck ofsenses on bash scripts.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/backup.sh | 12 | ||||
-rwxr-xr-x | scripts/cp-todos.sh | 2 | ||||
l--------- | scripts/dhall-gen.sh | 1 | ||||
-rwxr-xr-x | scripts/gc.sh | 12 | ||||
-rwxr-xr-x | scripts/mail.sh | 2 | ||||
-rwxr-xr-x | scripts/once-only-nextcloud.sh | 2 | ||||
-rwxr-xr-x | scripts/single-monitor.sh | 2 | ||||
-rwxr-xr-x | scripts/startx | 2 | ||||
-rwxr-xr-x | scripts/three-monitors.sh | 2 |
9 files changed, 20 insertions, 17 deletions
diff --git a/scripts/backup.sh b/scripts/backup.sh index a33a630..6a4de25 100755 --- a/scripts/backup.sh +++ b/scripts/backup.sh @@ -6,12 +6,12 @@ # if [ ! -d ~/UTCLOUD/ ]; then - red "~/UTCLOUD not attached. Backup not started." + red "$HOME/UTCLOUD not attached. Backup not started." exit 1 fi if [ ! -d ~/borgbackup/ ]; then - yellow "~/borgbackup/ repository doesn't exist. Downloading latest version from ~/UTCLOUD/borg/borgbackup/ into ~/borgbackup/" + yellow "$HOME/borgbackup/ repository doesn't exist. Downloading latest version from ~/UTCLOUD/borg/borgbackup/ into ~/borgbackup/" # The initial borg repo was created with: # $ borg init --append-only --encryption=keyfile ~/borgbackup # See also: https://borgbackup.readthedocs.io/en/stable/usage/notes.html#append-only-mode @@ -46,7 +46,7 @@ green "Done" # yellow "Backing up git repos" -pushd ~/ +pushd ~/ || exit 1 mr -s master mr -s status @@ -54,13 +54,13 @@ mr -s -j16 update mr -s hd mr -s -j4 rsyncnet -popd +popd || exit 1 yellow "Syncing annex" -pushd ~/annex/ +pushd ~/annex/ || exit 1 git annex sync -popd +popd || exit 1 green "Done" diff --git a/scripts/cp-todos.sh b/scripts/cp-todos.sh index 5ec5a0f..d8e6f30 100755 --- a/scripts/cp-todos.sh +++ b/scripts/cp-todos.sh @@ -1,2 +1,4 @@ +#!/usr/bin/env bash + cp "$HOME/annex/txt/TODOs.org" "$HOME/Nextcloud/Notes/org.txt" cp "$HOME/annex/txt/TODOs.org" "$HOME/Nextcloud/cache/TODOs.org" diff --git a/scripts/dhall-gen.sh b/scripts/dhall-gen.sh deleted file mode 120000 index 75b8290..0000000 --- a/scripts/dhall-gen.sh +++ /dev/null @@ -1 +0,0 @@ -../dhall/dhall-gen.sh
\ No newline at end of file diff --git a/scripts/gc.sh b/scripts/gc.sh index ac1b412..c4d3ec3 100755 --- a/scripts/gc.sh +++ b/scripts/gc.sh @@ -10,8 +10,8 @@ yellow "Cleaning up the NixOS store" profiles=(per-user/root/channels per-user/andreh/profile per-user/andreh/channels system) -for p in ${profiles[@]}; do - sudo nix-env --delete-generations old -p /nix/var/nix/profiles/$p +for p in "${profiles[@]}"; do + sudo nix-env --delete-generations old -p "/nix/var/nix/profiles/$p" done # Current profile, change when installing with =nix-env -iA nixpkgs.bsdgames= @@ -36,11 +36,11 @@ sudo find /tmp -type f -atime +10 -delete yellow "Erasing docker images" echo y | docker system prune -a -docker rmi $(docker images -a -q) -docker rm $(docker ps -a -f status=exited -q) +docker rmi "$(docker images -a -q)" +docker rm "$(docker ps -a -f status=exited -q)" -docker stop $(docker ps -a -q) -docker rm $(docker ps -a -q) +docker stop "$(docker ps -a -q)" +docker rm "$(docker ps -a -q)" echo y | docker volume prune echo y | docker container prune diff --git a/scripts/mail.sh b/scripts/mail.sh index a7c8208..00c111f 100755 --- a/scripts/mail.sh +++ b/scripts/mail.sh @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + if [ "$1" = "-s" ]; then mbsync -aV &>> /tmp/mbsync.log && notmuch new &>> /tmp/notmuch.log else diff --git a/scripts/once-only-nextcloud.sh b/scripts/once-only-nextcloud.sh index 8400080..7886b6f 100755 --- a/scripts/once-only-nextcloud.sh +++ b/scripts/once-only-nextcloud.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env bash if [ "$(pidof nextcloud)" ] then diff --git a/scripts/single-monitor.sh b/scripts/single-monitor.sh index ec6c5e2..5b0d03e 100755 --- a/scripts/single-monitor.sh +++ b/scripts/single-monitor.sh @@ -1,2 +1,2 @@ -#!/bin/sh +#!/usr/bin/env bash xrandr --output VIRTUAL1 --off --output eDP1 --primary --mode 1920x1080 --pos 640x1440 --rotate normal --output DP1 --off --output HDMI2 --off --output HDMI1 --off --output DP2 --off diff --git a/scripts/startx b/scripts/startx index 9b1d153..cca34a2 100755 --- a/scripts/startx +++ b/scripts/startx @@ -1,3 +1,3 @@ -#!/bin/sh +#!/usr/bin/env bash sudo systemctl restart display-manager & diff --git a/scripts/three-monitors.sh b/scripts/three-monitors.sh index d1ef7c6..d8c4e53 100755 --- a/scripts/three-monitors.sh +++ b/scripts/three-monitors.sh @@ -1,2 +1,2 @@ -#!/bin/sh +#!/usr/bin/env bash xrandr --output VIRTUAL1 --off --output eDP1 --primary --mode 1920x1080 --pos 640x1440 --rotate normal --output DP1 --off --output HDMI2 --off --output HDMI1 --mode 2560x1440 --pos 0x0 --rotate normal --output DP2 --mode 2560x1440 --pos 2560x0 --rotate left |