feat: manage custom scripts
This commit is contained in:
parent
7920388eb4
commit
a646ccf48f
3 changed files with 30 additions and 0 deletions
15
.helpers/scripts/install-scripts
Executable file
15
.helpers/scripts/install-scripts
Executable file
|
@ -0,0 +1,15 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
GIT_ROOT_DIR="$( cd "$( dirname $0 )/../.." && pwd )"
|
||||||
|
SCRIPTS_SOURCE_DIR="${GIT_ROOT_DIR}/scripts"
|
||||||
|
SCRIPTS_DESTINATION_DIR="${HOME}/.local/scripts"
|
||||||
|
|
||||||
|
if ! [ -d ${SCRIPTS_DESTINATION_DIR} ]; then
|
||||||
|
echo "INFO: Creating directory ${SCRIPTS_DESTINATION_DIR}"
|
||||||
|
mkdir ${SCRIPTS_DESTINATION_DIR}
|
||||||
|
fi
|
||||||
|
|
||||||
|
rsync -avh ${SCRIPTS_SOURCE_DIR}/ ${SCRIPTS_DESTINATION_DIR}
|
||||||
|
chmod -R 0700 ${SCRIPTS_DESTINATION_DIR}
|
4
Makefile
4
Makefile
|
@ -1,6 +1,10 @@
|
||||||
check_xdg_settings:
|
check_xdg_settings:
|
||||||
@./.helpers/xdg/check-xdg-settings
|
@./.helpers/xdg/check-xdg-settings
|
||||||
|
|
||||||
|
.PHONY: scripts
|
||||||
|
scripts:
|
||||||
|
@./.helpers/scripts/install-scripts
|
||||||
|
|
||||||
.PHONY: ansible_configs
|
.PHONY: ansible_configs
|
||||||
ansible_configs: check_xdg_settings
|
ansible_configs: check_xdg_settings
|
||||||
@./.helpers/ansible/generate-ansible-config
|
@./.helpers/ansible/generate-ansible-config
|
||||||
|
|
11
scripts/run_package_updates
Normal file
11
scripts/run_package_updates
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
# run_package_updates() ensures all apt packages are updated
|
||||||
|
# and runs autoremove to remove any unused packages.
|
||||||
|
sudo apt update
|
||||||
|
apt list --upgradable
|
||||||
|
sleep 5
|
||||||
|
sudo apt dist-upgrade
|
||||||
|
sudo apt autoremove
|
Loading…
Reference in a new issue