mirror of
https://codeberg.org/vlw/dotfiles.git
synced 2026-04-13 07:39:38 +02:00
Compare commits
No commits in common. "e9d980e3ff779dbb9dc35880d15ebe250b6599e6" and "d19f7002f7d1c1b4aaddab781a6185e07cc77262" have entirely different histories.
e9d980e3ff
...
d19f7002f7
2 changed files with 0 additions and 41 deletions
|
|
@ -1,38 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Confirm that we want to shutdown without https://git.vlw.se/pastebin/history
|
|
||||||
if [ ! -d "$XDG_DATA_HOME/history" ] ; then
|
|
||||||
read -p "No history directory found at '$XDG_DATA_HOME/history'. Command history will not be saved. Answer 'y' to shutdown anyways: " confirm
|
|
||||||
if [ "$confirm" != "y" ]; then
|
|
||||||
echo "Shutdown aborted"
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Shut down the system
|
|
||||||
sudo poweroff
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -f "$HOME/.bash_history" ]; then
|
|
||||||
echo "No '.bash_history' file found"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
file="$(date +"%Y-%m-%dT%H-%M-%S")-$(hostname).zip"
|
|
||||||
|
|
||||||
# Move into history directory
|
|
||||||
cd $XDG_DATA_HOME/history
|
|
||||||
|
|
||||||
# Zip .bash_history file with maximum compression
|
|
||||||
zip -9 $file $HOME/.bash_history
|
|
||||||
|
|
||||||
# Add the file to git and upload to remote
|
|
||||||
git add $file
|
|
||||||
git -c commit.gpgsign=false commit -m "add($(hostname)): '$file'"
|
|
||||||
git push origin master
|
|
||||||
|
|
||||||
# Empty the .bash_history file for next session
|
|
||||||
: > $HOME/.bash_history
|
|
||||||
|
|
||||||
# Shut down the system
|
|
||||||
sudo poweroff
|
|
||||||
3
Makefile
3
Makefile
|
|
@ -15,6 +15,3 @@ code-extensions:
|
||||||
# Install dev programs and configuration files
|
# Install dev programs and configuration files
|
||||||
programs:
|
programs:
|
||||||
~/.local/bin/scripts/install_programs.sh
|
~/.local/bin/scripts/install_programs.sh
|
||||||
|
|
||||||
shutdown:
|
|
||||||
~/.local/bin/scripts/shutdown.sh
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue