1779518802
This commit is contained in:
@@ -1,8 +1,12 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# todo:
|
# 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
|
## packages to add:
|
||||||
## enable start services: xrdp apache2 avahi-servicd scripot
|
## x enable start services: xrdp apache2 avahi-service
|
||||||
## run customscripts
|
## x run customscripts
|
||||||
|
## make less interactive
|
||||||
|
### visudo
|
||||||
|
### su user
|
||||||
|
|
||||||
# set safety optinonz
|
# set safety optinonz
|
||||||
set -o errexit # fail on error
|
set -o errexit # fail on error
|
||||||
set -o errtrace # run trace 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
|
set -o nounset # fail on unset var
|
||||||
|
|
||||||
# packages
|
# 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
|
# user info
|
||||||
new_username="princesspi"
|
new_username="princesspi"
|
||||||
@@ -18,7 +22,7 @@ groups_username=("tty" "dialout" "plugdev" "sudo" "www-data")
|
|||||||
home_username="/home/${new_username}"
|
home_username="/home/${new_username}"
|
||||||
|
|
||||||
# services shit
|
# 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")
|
services_to_disable=("nginx")
|
||||||
|
|
||||||
# save here to use in error_handle function
|
# save here to use in error_handle function
|
||||||
@@ -87,6 +91,25 @@ checkcode () {
|
|||||||
fi
|
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() {
|
user() {
|
||||||
echo "user: START"
|
echo "user: START"
|
||||||
echo "user: create $new_username"
|
echo "user: create $new_username"
|
||||||
@@ -142,6 +165,7 @@ pyenv() {
|
|||||||
echo "pyenv: setting latest python3 as global"
|
echo "pyenv: setting latest python3 as global"
|
||||||
pyenv global 3:latest &> /dev/null
|
pyenv global 3:latest &> /dev/null
|
||||||
checkcode $?
|
checkcode $?
|
||||||
|
reload_shell
|
||||||
echo "pyenv: FINISHED"
|
echo "pyenv: FINISHED"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -161,21 +185,19 @@ blesh() {
|
|||||||
checkcode $?
|
checkcode $?
|
||||||
echo 'source -- $home_username/.local/share/blesh/ble.sh' >> $home_username/.bashrc
|
echo 'source -- $home_username/.local/share/blesh/ble.sh' >> $home_username/.bashrc
|
||||||
checkcode $?
|
checkcode $?
|
||||||
echo 'ble.sh: sourcing $home_username/.bashrc'
|
reload_shell
|
||||||
checkcode $?
|
|
||||||
source $home_username/.bashrc
|
|
||||||
checkcode $?
|
|
||||||
echo "ble.sh: FINISHED"
|
echo "ble.sh: FINISHED"
|
||||||
}
|
}
|
||||||
|
|
||||||
wordists() {
|
wordists() {
|
||||||
echo "Wordlists: START"
|
echo "wordlists: START"
|
||||||
echo "wordlists: making $home_username/wordlists dir"
|
echo "wordlists: making $home_username/wordlists dir"
|
||||||
mkdir -p $home_username/wordlists &> /dev/null
|
mkdir -p $home_username/wordlists &> /dev/null
|
||||||
checkcode $?
|
checkcode $?
|
||||||
echo "wordlists: downloading seclists to $home_username/wordlists"
|
echo "wordlists: downloading seclists to $home_username/wordlists"
|
||||||
git clone --single-branch https://github.com/danielmiessler/SecLists.git $home_username/wordlists/SecLists &> /dev/null
|
git clone --single-branch https://github.com/danielmiessler/SecLists.git $home_username/wordlists/SecLists &> /dev/null
|
||||||
# todo: finish
|
# todo: finish
|
||||||
|
echo "wordlists: FINISHED"
|
||||||
}
|
}
|
||||||
|
|
||||||
services() {
|
services() {
|
||||||
@@ -218,12 +240,14 @@ customscripts() {
|
|||||||
echo "customscripts: updating user .bashrc"
|
echo "customscripts: updating user .bashrc"
|
||||||
echo 'export PATH="$PATH:/usr/share/customscripts' >> $home_username/.bashrc
|
echo 'export PATH="$PATH:/usr/share/customscripts' >> $home_username/.bashrc
|
||||||
checkcode $?
|
checkcode $?
|
||||||
echo "customscripts: sourcing to $home_username/.bashrc"
|
reload_shell
|
||||||
source $home_username/.bashrc
|
}
|
||||||
checkcode $?
|
|
||||||
echo "customscripts: reloading shell"
|
reboot() {
|
||||||
exec $SHELL
|
echo "reboot: START"
|
||||||
checkcode $?
|
echo "reboot: setting to reboot in one minute"
|
||||||
|
sudo shutdown -r +1
|
||||||
|
echo "reboot: FINISHED"
|
||||||
}
|
}
|
||||||
|
|
||||||
# run in order
|
# run in order
|
||||||
@@ -233,4 +257,5 @@ pyenv
|
|||||||
blesh
|
blesh
|
||||||
wordlists
|
wordlists
|
||||||
services
|
services
|
||||||
customscripts
|
customscripts
|
||||||
|
reboot
|
||||||
Reference in New Issue
Block a user