45 lines
1,007 B
Bash
45 lines
1,007 B
Bash
|
#!/bin/bash
|
||
|
# jeremystartm's sysdotfiles "installer"
|
||
|
|
||
|
if [ ! -f "/etc/.jstm_sysdotfiles" ]; then
|
||
|
echo ":: Removing files"
|
||
|
./uninstall.sh &> /dev/null
|
||
|
fi
|
||
|
|
||
|
# useful function
|
||
|
function link() {
|
||
|
if [ -a "/${2}" ]; then
|
||
|
[[ -n "$VERBOSE_WARNING" ]] && echo ":: Warning: ${2} already exists."
|
||
|
else
|
||
|
echo ":: Linking ${2}"
|
||
|
ln -s "$(pwd)/${1}" "/${2}"
|
||
|
fi
|
||
|
}
|
||
|
|
||
|
# update/clone repositories
|
||
|
if [ ! -d "jstmbash" ]; then
|
||
|
git clone "https://git.staropensource.de/JeremyStarTM/jstmbash.git" jstmbash
|
||
|
else
|
||
|
cd jstmbash
|
||
|
git pull
|
||
|
cd ..
|
||
|
fi
|
||
|
|
||
|
# create directories
|
||
|
#mkdir -p "/unused/"
|
||
|
|
||
|
# bash configuration
|
||
|
link "jstmbash" "etc/jstmbash"
|
||
|
link "lone-files/jstmbash.config.env" "etc/jstmbash.env"
|
||
|
link "lone-files/bashrc" "etc/bash.bashrc"
|
||
|
|
||
|
# makepkg
|
||
|
link "lone-files/makepkg.conf" "etc/makepkg.conf"
|
||
|
|
||
|
# punktdateien scripts
|
||
|
link "bin/updatechecker" "usr/local/bin/sysdotfiles-updatechecker"
|
||
|
link "bin/updater" "usr/local/bin/sysdotfiles-updater"
|
||
|
|
||
|
# write install file
|
||
|
echo "pls don't remove" > "/etc/.jstm_sysdotfiles"
|