Merge branch 'master' of 192.168.1.2:ahurac/dotfiles

This commit is contained in:
Hippolyte Chauvin 2023-05-08 18:53:44 +02:00
commit 15f2cc0a29
3 changed files with 9 additions and 34 deletions

4
README.md Normal file
View file

@ -0,0 +1,4 @@
# Ahurac dotfiles
[![Please don't upload to GitHub](https://nogithub.codeberg.page/badge.svg)](https://nogithub.codeberg.page)

View file

@ -1,38 +1,8 @@
#!/bin/bash #!/bin/sh -e
# Variables
sudo=sudo
renice=renice
pid="$(pidof "$1")" pid="$(pidof "$1")"
# Error function
error() {
>&2 echo -e "\033[1;31mERROR:\033[0m $1"; shift
exit "${1:-1}"
}
# Test if process exists
if [[ -z $pid ]]; then
error "No such process." 1
else
shift shift
fi prio="${1:--22}"
# Arguments sudo renice "$prio" "$pid"
prio="${1:--20}"; shift
# Command building
renice=(
"$sudo"
"$renice"
"$prio"
"$pid"
)
# Debug
#echo "${renice[@]}"
#exit 0
# Execution
"${renice[@]}"

View file

@ -1,5 +1,6 @@
#!/bin/sh -e #!/bin/sh -e
path="${1:-.}/$(date +'%Y_%m_%d')" path="${1:-.}/$(date +'%Y_%m_%d')"
shift
mkdir "$@" -p "$path" mkdir "$@" -p "$path"
echo "$path" echo "$path"