From aa7f6f7c8fc275d6b80cc07a97b9e8f0b05c7069 Mon Sep 17 00:00:00 2001 From: DarkFeather Date: Thu, 27 Jul 2017 15:30:48 -0500 Subject: [PATCH] ShadowArch and other fixes --- Admin/Makefile | 3 ++- Admin/clean-exim | 4 ---- Admin/clean-exim-input | 3 --- ShadowArch/Makefile | 4 ++-- ShadowArch/bash.bashrc | 1 + ShadowArch/shadowarch | 16 +++++++--------- Shared/whatismyip | 4 +--- 7 files changed, 13 insertions(+), 22 deletions(-) delete mode 100755 Admin/clean-exim delete mode 100755 Admin/clean-exim-input diff --git a/Admin/Makefile b/Admin/Makefile index ce14cb7..a1ff94e 100644 --- a/Admin/Makefile +++ b/Admin/Makefile @@ -1,7 +1,8 @@ -LIST=arch-update clean-exim clean-exim-input close-guest fix-sound log-guest open-guest restart-service silent-guardian revproxy simple-web +LIST=arch-update close-guest fix-sound log-guest open-guest restart-service silent-guardian revproxy simple-web LOCATION=/root/bin INSTALLER != curl -s https://aninix.net/foundation/installer-test.bash | /bin/bash PERMISSION=0700 + compile: @echo Nothing to compile. diff --git a/Admin/clean-exim b/Admin/clean-exim deleted file mode 100755 index b46fa37..0000000 --- a/Admin/clean-exim +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -exim -bp | exiqgrep -i | xargs exim -Mrm - diff --git a/Admin/clean-exim-input b/Admin/clean-exim-input deleted file mode 100755 index 44db42c..0000000 --- a/Admin/clean-exim-input +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -ls /var/spool/exim/input | cut -c1-16 | xargs exim -Mrm diff --git a/ShadowArch/Makefile b/ShadowArch/Makefile index 76d2681..204378f 100644 --- a/ShadowArch/Makefile +++ b/ShadowArch/Makefile @@ -15,7 +15,7 @@ install: compile # This is a nicety. if [ -f /root/shadowarch* ]; then sed -i 's/`uname -o`/ShadowArch/g' /etc/bash.bashrc; fi -repository: shadowarch +repository: shadowarch ${HTTPROOT} cp ./shadowarch ${HTTPROOT} checkperm: ${SYNCLIST} @@ -39,7 +39,7 @@ clean: diff: ${HTTPROOT}/shadowarch ${SYNCLIST} diff ./shadowarch ${HTTPROOT}/shadowarch - for i in ${SYNCLIST}; do diff "${i}" ./`echo ${i} | rev | cut -f 1 -d '/' | rev` || [ 1 -eq 1 ]; done + for i in ${SYNCLIST}; do diff "$$i" ./`echo $$i | rev | cut -f 1 -d '/' | rev` || [ 1 -eq 1 ]; done find-missing-hooks-in-src: @for i in `wget -q -O - https://aninix.net/foundation/ | grep toplevel-repo | cut -f 4 -d \'`; do if [ -z $$i ]; then continue; fi; for file in `find ../.. -type f -name Makefile | grep $$i`; do if [ -z "$$file" ]; then echo NO MAKEFILE FOR $$i; elif [ `grep -c -i 'hook for systemd' $$file` -eq 0 ]; then echo HOOK MISSING IN: $$file; else echo HOOK FOUND IN: $$file; fi; done; done diff --git a/ShadowArch/bash.bashrc b/ShadowArch/bash.bashrc index 5a6c707..95ad67d 100644 --- a/ShadowArch/bash.bashrc +++ b/ShadowArch/bash.bashrc @@ -33,6 +33,7 @@ alias vi=vim alias view="vim -R" alias top="top -o %CPU" alias make-entrypoints="egrep '^[a-zA-Z0-9\-]*:' Makefile" +if [ -x `which torsocks` ] && [ `systemctl status tor | grep -c running` -eq 1 ]; then alias tor-lynx="torsocks lynx https://check.torproject.org/"; fi IFS=" " diff --git a/ShadowArch/shadowarch b/ShadowArch/shadowarch index cd946ad..90d5e94 100644 --- a/ShadowArch/shadowarch +++ b/ShadowArch/shadowarch @@ -33,7 +33,7 @@ bootpart=1; rootpart=2; datapart=99; # TODO Add LVM as an argument -while getopts "ed:gps" OPTION +while getopts "d:egkpmsz" OPTION do case $OPTION in d) disk=${OPTARG} ;; @@ -138,9 +138,9 @@ fi if [ "$kali" -eq 1 ]; then export pkglist="$pkglist"" extundelete testdisk nmap tcpdump hexedit dcfldd" if [ "$gui" -eq 1 ]; then - export pkglist=" wireshark-gtk" + export pkglist="$pkglist"" wireshark-gtk" else - export pkglist=" wireshark-cli" + export pkglist="$pkglist"" wireshark-cli" fi fi if [ "$kitchensink" -eq 1 ]; then @@ -156,12 +156,9 @@ genfstab -U /mnt >> /mnt/etc/fstab header Set time sed -i 's/#en_US.UTF-8/en_US.UTF-8/' /mnt/etc/locale.gen arch-chroot /mnt locale-gen -ln -s /usr/share/zoneinfo/America/Chicago /mnt/etc/localtime +ln -sf /usr/share/zoneinfo/America/Chicago /mnt/etc/localtime arch-chroot /mnt hwclock --systohc --utc -# Leave a trace of the install. -cp /root/shadowarch /mnt/root/shadowarch.installer."$(date +%F-%R)" - header Setup bootloader if [ "$nodiskbuild" -eq 0 ]; then export rootuuid="$(blkid "$disk""$rootpart" | cut -f 2 -d '"')" @@ -193,8 +190,8 @@ arch-chroot /mnt systemctl enable netctl arch-chroot /mnt netctl enable $interface # Vim cleanup for SSH -mkdir -p /usr/share/vim/vimfiles/plugin -printf 'set mouse-=a\n' > /usr/share/vim/vimfiles/plugin/shadowarch.vim +arch-chroot /mnt mkdir -p /usr/share/vim/vimfiles/plugin +arch-chroot /mnt printf 'set mouse-=a\n' > /usr/share/vim/vimfiles/plugin/shadowarch.vim ln -sf /etc/skel/.bashrc /mnt/root/.bashrc @@ -226,6 +223,7 @@ arch-chroot /mnt chown -R depriv:depriv /usr/local/src/ # Set SSH host keys arch-chroot /mnt ssh-keygen -A +cp /root/shadowarch /mnt/root/shadowarch.installer."$(date +%F-%R)" if [ "$gui" -eq 1 ]; then echo "Remember to install your graphics drivers! diff --git a/Shared/whatismyip b/Shared/whatismyip index cfee24b..6ed448d 100755 --- a/Shared/whatismyip +++ b/Shared/whatismyip @@ -1,4 +1,2 @@ #!/bin/bash -/usr/bin/lynx --dump whatismyipaddress.com | grep '/ip/' | head -n 1 | cut -f 5 -d '/' - - +/usr/bin/lynx -connect_timeout=5 -read_timeout=5 -timeout=5 --dump whatismyipaddress.com | grep '/ip/' | head -n 1 | cut -f 5 -d '/'