Compare commits
3 commits
Author | SHA1 | Date | |
---|---|---|---|
|
ba52a96a60 | ||
dd70dd0ad4 | |||
f9907d9a71 |
10 changed files with 41 additions and 150 deletions
|
@ -1,27 +0,0 @@
|
|||
name = "example" #*
|
||||
description = "hello"
|
||||
author = ":$3"
|
||||
|
||||
# [ LINKS ]
|
||||
# This defines what links should be made.
|
||||
# vars:
|
||||
# "$CRATE" expands to path of directory of this file.
|
||||
# "$CROOT" expands to base directory / cwd from the runner
|
||||
# prefixes:
|
||||
# "#" - system root
|
||||
# "~" - home of user or user defined in options
|
||||
# "%" - temp directory
|
||||
[links]
|
||||
"$CRATE/system.sh" = { name = "/etc/system_boot", su = "true" }
|
||||
"$CRATE/system2.sh" = "#/etc/system_boot.sh" # same as above
|
||||
|
||||
# [ COPIES ]
|
||||
# basically the same as links but copies
|
||||
[copies]
|
||||
"$CRATE/system3.sh" = "#/etc/system_boot.sh" # same as above
|
||||
|
||||
# [ SCRIPTS ]
|
||||
# Run stuff
|
||||
[scripts]
|
||||
"$CRATE/system/net_config.sh" = 1
|
||||
"$CRATE/system/net_config2.sh" = { su = "false" }
|
|
@ -1 +1 @@
|
|||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCeNQfnbyyF3sht43vH5BcXDPca8nWu6bKPVGvAlWBOq4Av8ME2IQgwVe9nJ05r73ZY02/Vdqc01a8wyK5Hmw0XlPL0Cn6wc9QoiscOvq5lMUK87S2tr3EVLGkgl8o7nmVuWgLewyojiORjM02P1PZEiFhKPXVEQFxU0dFz9QtpAdm0u78Xn2HTukHpXSv44R3XDDMFZ3Ek/XRuS6J9dZVxGkgCLQhK8kpfbxuiYxaRC7MHgGlYuxjLuZ6P4i+V+SSSShfCGdm6U9bgeIAwftN6a8Pc9+OsBeZGSUrGjZjRlD35q0a7fbpoS8pKTfbwgf/ijYeu3JmAQUlY+H959mIpg4H9XOgRrKVJSYwx5/BGuhmWgVy6HIYpXCQfEbLE7QDmwC2C430KzAH6jCcrRNyurIUCuO4iq9dwoQTzboMccOK79S2Z+1B5fYgS3BZgaiTUBSME2G2FriM6utgleiBnvFu/p7oH2I8ZHL/aVcSWAw0gbzsr7ADywAuiDNZk18c= raine@ryuk
|
||||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCeNQfnbyyF3sht43vH5BcXDPca8nWu6bKPVGvAlWBOq4Av8ME2IQgwVe9nJ05r73ZY02/Vdqc01a8wyK5Hmw0XlPL0Cn6wc9QoiscOvq5lMUK87S2tr3EVLGkgl8o7nmVuWgLewyojiORjM02P1PZEiFhKPXVEQFxU0dFz9QtpAdm0u78Xn2HTukHpXSv44R3XDDMFZ3Ek/XRuS6J9dZVxGkgCLQhK8kpfbxuiYxaRC7MHgGlYuxjLuZ6P4i+V+SSSShfCGdm6U9bgeIAwftN6a8Pc9+OsBeZGSUrGjZjRlD35q0a7fbpoS8pKTfbwgf/ijYeu3JmAQUlY+H959mIpg4H9XOgRrKVJSYwx5/BGuhmWgVy6HIYpXCQfEbLE7QDmwC2C430KzAH6jCcrRNyurIUCuO4iq9dwoQTzboMccOK79S2Z+1B5fYgS3BZgaiTUBSME2G2FriM6utgleiBnvFu/p7oH2I8ZHL/aVcSWAw0gbzsr7ADywAuiDNZk18c= strix@ryuk
|
|
@ -4,6 +4,6 @@ describe="Setup git"
|
|||
scripts="@distro @self"
|
||||
|
||||
apply() {
|
||||
git config --global user.name Raine
|
||||
git config --global user.email raine@ixvd.net
|
||||
git config --global user.name Strix
|
||||
git config --global user.email strix@saluco.nl
|
||||
}
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
apply() {
|
||||
echo "------------ WARNING ------------"
|
||||
echo "BACKUPS ARE NOT SETUP ON DEBIAN! "
|
||||
echo " PLEASE SETUP MANUALLY "
|
||||
echo "---------------------------------"
|
||||
}
|
|
@ -1,4 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
describe="Setup restic backups"
|
||||
scripts="@distro" # only distro
|
|
@ -1,41 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
HOSTNAME=${HOSTNAME:-$(hostname)}
|
||||
|
||||
log() {
|
||||
echo "log: $@"
|
||||
if [ -f "/var/backups/ntfy.env" ]; then
|
||||
. /var/backups/ntfy.env
|
||||
curl \
|
||||
-s \
|
||||
-d "$@" \
|
||||
${NTFY_URL:-https://push.ixvd.net/logs}
|
||||
fi
|
||||
}
|
||||
|
||||
log starting backup for $HOSTNAME
|
||||
restic \
|
||||
-r /var/backups/$HOSTNAME \
|
||||
-p /var/backups/$HOSTNAME.secret \
|
||||
backup \
|
||||
--tag auto \
|
||||
--exclude-caches \
|
||||
--exclude dist \
|
||||
--exclude target \
|
||||
--exclude node_modules \
|
||||
--exclude bin \
|
||||
--exclude .cache \
|
||||
--exclude '.config/*/cache' \
|
||||
--exclude '.config/*/Cache' \
|
||||
--exclude .cargo/git \
|
||||
--exclude .cargo/registry \
|
||||
--exclude '.rustup' \
|
||||
--exclude '.local' \
|
||||
--exclude '.var' \
|
||||
--exclude Steam \
|
||||
--exclude '.config/Code' \
|
||||
--exclude '.config/Code - OSS' \
|
||||
--exclude 'code/linux' \
|
||||
--exclude Downloads \
|
||||
/srv /home /etc
|
||||
log backup finished with $?
|
|
@ -1,10 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
HOSTNAME=${HOSTNAME:-$(hostname)}
|
||||
|
||||
[ -d "/var/backups" ] || mkdir -p /var/backups
|
||||
[ -f "/var/backups/$HOSTNAME.secret" ] || openssl rand -hex 64 > /var/backups/$HOSTNAME.secret
|
||||
|
||||
restic init \
|
||||
-r /var/backups/$HOSTNAME \
|
||||
-p /var/backups/$HOSTNAME.secret
|
|
@ -1,11 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# sync backup to *the* external
|
||||
|
||||
HOSTNAME=${HOSTNAME:-$(hostname)}
|
||||
|
||||
set -e
|
||||
|
||||
rsync \
|
||||
--info=progress2 \
|
||||
-avzylu \
|
48
dot
48
dot
|
@ -26,21 +26,6 @@ func() {
|
|||
is_function $2 && $2
|
||||
}
|
||||
|
||||
get_command() {
|
||||
case $1 in
|
||||
a*)
|
||||
printf "apply"
|
||||
;;
|
||||
u*)
|
||||
printf "undo"
|
||||
;;
|
||||
*)
|
||||
echo "err: not supported" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# only run this *in crate dir*
|
||||
run_crate() {
|
||||
enabled=1
|
||||
|
@ -51,7 +36,7 @@ run_crate() {
|
|||
if [ $enabled -ne 1 ]; then
|
||||
return
|
||||
fi
|
||||
cmd=$(get_command $1)
|
||||
cmd=$1
|
||||
scripts=${scripts:-"@self @distro"}
|
||||
for s in $scripts; do
|
||||
echo "exec($(basename $PWD)): $s/$cmd"
|
||||
|
@ -80,18 +65,25 @@ echo "# user: $USER (${UID:-$(id -u)})"
|
|||
echo "# groups: $(groups)"
|
||||
echo "# distro: $(curr_distro)"
|
||||
|
||||
if [ $# -eq 2 ]; then
|
||||
[ -d crates/*$1 ] || exit 1
|
||||
cd crates/*$1
|
||||
run_crate $2
|
||||
cd ../..
|
||||
cmd=$1
|
||||
if [ -z "$cmd" ]; then
|
||||
echo "usage: $0 <command> [...args]"
|
||||
exit 1
|
||||
else
|
||||
[ $# -eq 0 ] && exit 2
|
||||
for crate in $(find ./crates -mindepth 1 -maxdepth 1 -type d | sort); do
|
||||
cd $crate
|
||||
run_crate $1
|
||||
cd ../..
|
||||
done
|
||||
shift
|
||||
fi
|
||||
|
||||
|
||||
for c in ${@:-$(ls crates)}; do
|
||||
[ -d crates/*$c ] || exit 1
|
||||
cd crates/*$c
|
||||
case $cmd in
|
||||
a | apply)
|
||||
run_crate apply
|
||||
;;
|
||||
u | undo)
|
||||
run_crate undo
|
||||
;;
|
||||
*) exit 1 ;;
|
||||
esac
|
||||
cd ../..
|
||||
done
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
# this script is meant to be ran when .dotfiles is not present.
|
||||
#
|
||||
# example:
|
||||
# curl https://git.ixvd.net/raine/dotfiles/raw/branch/main/remote_script.sh | sh
|
||||
# curl https://git.saluco.nl/strix/dotfiles/raw/branch/main/remote_script.sh | sh
|
||||
|
||||
set -e
|
||||
|
||||
HOME=${HOME:-/home/${USER:-$(whomai)}}
|
||||
|
||||
[ -d "$HOME/.dotfiles" ] || git clone https://git.ixvd.net/raine/dotfiles $HOME/.dotfiles
|
||||
[ -d "$HOME/.dotfiles" ] || git clone https://git.saluco.nl/strix/dotfiles $HOME/.dotfiles
|
||||
cd $HOME/.dotfiles
|
||||
./dot a
|
||||
|
|
Loading…
Reference in a new issue