1779518802

This commit is contained in:
2026-05-23 00:46:41 -06:00
parent 89b919cc45
commit 30b6c00cd5
+42 -17
View File
@@ -1,8 +1,12 @@
#!/bin/bash
# todo:
## packages to add: cowsay iotop iptraf-ng gh btop htop screen byobu wget thefuck lynx zip unzip 7zip net-tools clamav php restic cifs-utils detox fdupes ffmpeg ffplay ripgrep avahi-daemon libnss-mdns xxd libimage-exiftool-perl ffuf
## enable start services: xrdp apache2 avahi-servicd scripot
## run customscripts
## packages to add:
## x enable start services: xrdp apache2 avahi-service
## x run customscripts
## make less interactive
### visudo
### su user
# set safety optinonz
set -o errexit # fail on error
set -o errtrace # run trace on error
@@ -10,7 +14,7 @@ set -o pipefail # fail on pipe fail
set -o nounset # fail on unset var
# packages
new_packages=(gawk curl wget git gh build-essential scrypt openssl argon2 qbittorrent xfce4 gparted xrdp xz-utils 7zip zip unzip gzip apache2 php php-cli php-bz2 php-crypt-gpg php-curl php-db php-doc php-email-validator cowsay iotop iptraf-ng gh btop htop screen byobu wget thefuck lynx zip unzip 7zip net-tools clamav php restic cifs-utils detox fdupes ffmpeg ripgrep avahi-daemon libnss-mdns xxd libimage-exiftool-perl ffuf wireshark hashcat snap pipx)
new_packages=(gawk curl wget git gh build-essential scrypt openssl argon2 qbittorrent xfce4 gparted xrdp xz-utils 7zip zip unzip gzip apache2 php php-cli php-bz2 php-crypt-gpg php-curl php-db php-doc php-email-validator cowsay iotop iptraf-ng gh btop htop screen byobu wget thefuck lynx zip unzip 7zip net-tools clamav php restic cifs-utils detox fdupes ffmpeg ripgrep avahi-daemon libnss-mdns xxd libimage-exiftool-perl ffuf wireshark hashcat snap pipx restic firefox)
# user info
new_username="princesspi"
@@ -18,7 +22,7 @@ groups_username=("tty" "dialout" "plugdev" "sudo" "www-data")
home_username="/home/${new_username}"
# services shit
services_to_enable=("apache2" "xrdp" "avahi-daemon" "avahi-utils")
services_to_enable=("ssh" "apache2" "xrdp" "avahi-daemon" "avahi-utils")
services_to_disable=("nginx")
# save here to use in error_handle function
@@ -87,6 +91,25 @@ checkcode () {
fi
}
reload_shell() {
echo "reload_shell: START"
echo "reload_shell: sourcing to $home_username/.bashrc"
source "$home_username/.bashrc"
checkcode $?
echo "reload_shell: reloading shell"
exec "$SHELL"
checkcode $?
echo "reload_shell: FINISHED"
}
reset_root() {
echo "reset_root: START"
echo "reset_root: change password"
sudo passwd root
chkcode $?
echo "reset_root: FINISHED"
}
user() {
echo "user: START"
echo "user: create $new_username"
@@ -142,6 +165,7 @@ pyenv() {
echo "pyenv: setting latest python3 as global"
pyenv global 3:latest &> /dev/null
checkcode $?
reload_shell
echo "pyenv: FINISHED"
}
@@ -161,21 +185,19 @@ blesh() {
checkcode $?
echo 'source -- $home_username/.local/share/blesh/ble.sh' >> $home_username/.bashrc
checkcode $?
echo 'ble.sh: sourcing $home_username/.bashrc'
checkcode $?
source $home_username/.bashrc
checkcode $?
reload_shell
echo "ble.sh: FINISHED"
}
wordists() {
echo "Wordlists: START"
echo "wordlists: START"
echo "wordlists: making $home_username/wordlists dir"
mkdir -p $home_username/wordlists &> /dev/null
checkcode $?
echo "wordlists: downloading seclists to $home_username/wordlists"
git clone --single-branch https://github.com/danielmiessler/SecLists.git $home_username/wordlists/SecLists &> /dev/null
# todo: finish
echo "wordlists: FINISHED"
}
services() {
@@ -218,12 +240,14 @@ customscripts() {
echo "customscripts: updating user .bashrc"
echo 'export PATH="$PATH:/usr/share/customscripts' >> $home_username/.bashrc
checkcode $?
echo "customscripts: sourcing to $home_username/.bashrc"
source $home_username/.bashrc
checkcode $?
echo "customscripts: reloading shell"
exec $SHELL
checkcode $?
reload_shell
}
reboot() {
echo "reboot: START"
echo "reboot: setting to reboot in one minute"
sudo shutdown -r +1
echo "reboot: FINISHED"
}
# run in order
@@ -233,4 +257,5 @@ pyenv
blesh
wordlists
services
customscripts
customscripts
reboot