add cmd addfonts

This commit is contained in:
Laila van Reenen 2025-09-03 16:47:24 +02:00
parent 0e36a3a145
commit 5dcf01eff2
Signed by: LailaTheElf
GPG Key ID: 8A3EF0226518C12D
2 changed files with 36 additions and 0 deletions

View File

@ -0,0 +1,36 @@
#!/bin/bash
function install() {
name=$1
src_dir=$2
mkdir -p /usr/share/fonts/$name
cp $src_dir/*.ttf /usr/share/fonts/$name/
chmod 0775 /usr/share/fonts/$name
chmod 0664 /usr/share/fonts/$name/*
}
function help() {
echo "$0 <font name> <sorce dir>"
}
if [[ -z "$1" ]]; then
help
exit
fi
if [[ -z "$2" ]]; then
echo "ERROR: give at least two arguments"
echo
help
exit
fi
if [[ ! -d "$2" ]]; then
echo "ERROR: $2 is not a directory"
echo
help
exit
fi
install $1 "$2"