Browse Source

well...

main
Nova[有線魔女] 2 months ago
parent
commit
871c6377f0
  1. 16
      README.md
  2. 1
      config.mk
  3. 3
      nofetch
  4. 39
      system-backup

16
README.md

@ -1,12 +1,16 @@
# posix-sh-tools
posix-sh-tools
--------------
Nova's posix shell scripts collection
## license
license
-------
- gpl-3.0-or-later
## summary
- adblock
* worse-than-useless (imo) script which downloads hosts file for use in /etc/hosts
summary
-------
- desktop-file-generator
* interactive script which can make .desktop files according to freedesktop's spec
- ipcheck
@ -17,8 +21,6 @@ Nova's posix shell scripts collection
* minimal version of [~tomasino's pb][2]
- nofetch
* a neofetch-like utility without all the fancy stuff
- system-backup
* wrapper to squashfs-tools to help you do a full system backup
- termbin
* more or less a copy-paste from [termbin](https://termbin.com) but made better
- weather

1
config.mk

@ -6,6 +6,5 @@ STUFF = desktop-file-generator \
linx \
minpb \
nofetch \
system-backup \
termbin \
weather

3
nofetch

@ -4,7 +4,8 @@
# dependencies: any core utilities implementation should work just fine.
printf "Architecture: $(uname -m) \n"
printf "Hostname: $(hostname -f) \n"
printf "Hostname: $(hostname) \n"
printf "Kernel version: $(uname -r) \n"
printf "User: $(whoami) ($(id -u)) \n"
printf "Uptime & Load average: [$(uptime | sed -E 's/.+up +//; s/,.+: /][/; s/,//g')] \n"
printf "Shell: $SHELL \n"

39
system-backup

@ -1,39 +0,0 @@
#!/bin/sh
# Since this can access to files on the system root you really should use either doas/sudo or plain su to actually do whatever its supposed to do =)
# Env vars
DIRS="bin etc home lib lib64 opt root sbin srv usr var"
OUTFILE="backup-$(date +%Y%m%d).squashfs"
COMP="gzip"
# Dir loop is absolutely retarded , idfk how it works anyway
COREFS=""
for i in $DIRS; do
if [ -d /$i ]; then
COREFS="$COREFS /$i"
fi
done
# Create output directory
if [ ! -d /backups ]; then
mkdir -p -v /backups/
fi
# Do the fucking thing
# To use other compression methods just invoke this script in the following manner :
# e.g. COMP="xz" system-backup
if [ $COMP = "gzip" ];then
mksquashfs $COREFS /backups/${OUTFILE} -comp gzip -b 1024K -always-use-fragments -keep-as-directory
fi
if [ $COMP = "lz4" ]; then
mksquashfs $COREFS /backups/${OUTFILE} -comp lz4 -Xhc -b 1024K -always-use-fragments -keep-as-directory
fi
if [ $COMP = "lzo" ]; then
mksquashfs $COREFS /backups/${OUTFILE} -comp lzo -xalgorithm lzo1x_999 -always-use-fragments -keep-as-directory
fi
if [ $COMP = "xz" ]; then
mksquashfs $COREFS /backups/${OUTFILE} -comp xz -xbcj x86 -always-use-fragments -keep-as-directory
fi
if [ $COMP = "zstd" ];then
mksquashfs $COREFS /backups/${OUTFILE} -comp zstd -Xcompression-level 22 -always-use-fragments -keep-as-directory
fi
Loading…
Cancel
Save