From 2a862d9141a84b612ec2dd109a7f74a2b10ffb91 Mon Sep 17 00:00:00 2001 From: builder Date: Fri, 26 Feb 2021 00:18:20 +0000 Subject: tools scripts moved to linux --- linux/scripts/mirror-system | 73 +++++++++++++++++++++++++++++ linux/scripts/pkgmk-test.conf | 19 ++++++++ linux/scripts/pkgmk-test.sh | 5 ++ linux/scripts/replace.sh | 9 ++++ linux/scripts/runvm/c12-dvd | 15 ++++++ linux/scripts/runvm/profile/crux | 7 +++ linux/scripts/runvm/runvm.sh | 26 +++++++++++ linux/scripts/setup-gitolite.sh | 43 ++++++++++++++++++ linux/scripts/setup-nginx.sh | 24 ++++++++++ linux/scripts/setup-openssh.sh | 43 ++++++++++++++++++ linux/scripts/setup-php.sh | 7 +++ linux/scripts/setup-postgresql.sh | 87 +++++++++++++++++++++++++++++++++++ linux/scripts/setup-x.sh | 96 +++++++++++++++++++++++++++++++++++++++ tools/scripts/mirror-system | 73 ----------------------------- tools/scripts/pkgmk-test.conf | 19 -------- tools/scripts/pkgmk-test.sh | 5 -- tools/scripts/replace.sh | 9 ---- tools/scripts/runvm/c12-dvd | 15 ------ tools/scripts/runvm/profile/crux | 7 --- tools/scripts/runvm/runvm.sh | 26 ----------- tools/scripts/setup-gitolite.sh | 43 ------------------ tools/scripts/setup-nginx.sh | 24 ---------- tools/scripts/setup-openssh.sh | 43 ------------------ tools/scripts/setup-php.sh | 7 --- tools/scripts/setup-postgresql.sh | 87 ----------------------------------- tools/scripts/setup-x.sh | 96 --------------------------------------- 26 files changed, 454 insertions(+), 454 deletions(-) create mode 100755 linux/scripts/mirror-system create mode 100644 linux/scripts/pkgmk-test.conf create mode 100644 linux/scripts/pkgmk-test.sh create mode 100755 linux/scripts/replace.sh create mode 100644 linux/scripts/runvm/c12-dvd create mode 100644 linux/scripts/runvm/profile/crux create mode 100644 linux/scripts/runvm/runvm.sh create mode 100644 linux/scripts/setup-gitolite.sh create mode 100644 linux/scripts/setup-nginx.sh create mode 100644 linux/scripts/setup-openssh.sh create mode 100644 linux/scripts/setup-php.sh create mode 100644 linux/scripts/setup-postgresql.sh create mode 100644 linux/scripts/setup-x.sh delete mode 100755 tools/scripts/mirror-system delete mode 100644 tools/scripts/pkgmk-test.conf delete mode 100644 tools/scripts/pkgmk-test.sh delete mode 100755 tools/scripts/replace.sh delete mode 100644 tools/scripts/runvm/c12-dvd delete mode 100644 tools/scripts/runvm/profile/crux delete mode 100644 tools/scripts/runvm/runvm.sh delete mode 100644 tools/scripts/setup-gitolite.sh delete mode 100644 tools/scripts/setup-nginx.sh delete mode 100644 tools/scripts/setup-openssh.sh delete mode 100644 tools/scripts/setup-php.sh delete mode 100644 tools/scripts/setup-postgresql.sh delete mode 100644 tools/scripts/setup-x.sh diff --git a/linux/scripts/mirror-system b/linux/scripts/mirror-system new file mode 100755 index 0000000..6c8a528 --- /dev/null +++ b/linux/scripts/mirror-system @@ -0,0 +1,73 @@ +#!/bin/bash + +if [ -f /tmp/mirror ]; then + echo "mirror system is already running" + exit 0 +fi + +touch /tmp/mirror + +#BUILD_NAME="R2D9" +#BUILD_TITLE="${BUILD_NAME}-$(cat /usr/ports/releases/stable/metadata/build-version)" +BUILD_TITLE="Crux 3.6" + +# Update system +ports -u + +# make them look like updated +echo "touch packages..." +for package in /usr/ports/packages/*; do + touch ${package}; +done + +# make sure permissions are right +echo "chown pkgmk:pkgmk -R /usr/ports" +chown pkgmk:pkgmk -R /usr/ports + +echo "update system" +prt-get depinst $(prt-get listinst | xargs prt-get quickdep) +prt-get sysup +prt-get update -fr $(revdep) + +# Create list of installed packages +echo "creating list of installed..." +rm -r /usr/ports/installed +pkg_installed + +### clean distribution files +mkdir -p /usr/ports/archive/distfiles +mv /usr/ports/distfiles/* /usr/ports/archive/distfiles +### clean packages files +mkdir -p /usr/ports/archive/packages +mv /usr/ports/packages/* /usr/ports/archive/packages +### get sources and packages +cd /usr/ports/installed +for installed in *; do + prt-get path $installed | while read -r line; do + cd $line + ##get source + sudo -u pkgmk -g pkgmk pkgmk -do + #make sure package exists + current="${installed}#$(prt-get current ${installed}).pkg.tar.gz" + echo "checking $current ..." + cp /usr/ports/archive/packages/${current} /usr/ports/packages/ + #prt-get update $installed + done +done + +# Create repository +echo "creating repository" +cd /usr/ports/packages +pkg-repgen + +# Create mirror page +echo "creating mirror index page" +portspage --title=${BUILD_TITLE} /usr/ports/installed > /usr/ports/installed/index.html + +sed -i "s@usr\/ports\/installed@mirror/installed@g" /usr/ports/installed/index.html + +echo "setting permissions /usr/ports" +chown pkgmk:pkgmk -R /usr/ports + +# Remove temporary file +rm /tmp/mirror diff --git a/linux/scripts/pkgmk-test.conf b/linux/scripts/pkgmk-test.conf new file mode 100644 index 0000000..4a04eec --- /dev/null +++ b/linux/scripts/pkgmk-test.conf @@ -0,0 +1,19 @@ +# +# /etc/pkgmk.conf: pkgmk(8) configuration +# + +source /etc/pkgmk.conf + +#PKGMK_SOURCE_MIRRORS=(http://c1.ank/distfiles/) +PKGMK_SOURCE_DIR="$PWD" +PKGMK_PACKAGE_DIR="$PWD" +PKGMK_WORK_DIR="$PWD/work" +PKGMK_DOWNLOAD="yes" +PKGMK_UP_TO_DATE="no" +# PKGMK_IGNORE_FOOTPRINT="no" +# PKGMK_IGNORE_NEW="no" +# PKGMK_NO_STRIP="no" +# PKGMK_DOWNLOAD_PROG="wget" +# PKGMK_WGET_OPTS="" +# PKGMK_CURL_OPTS="" +# PKGMK_COMPRESSION_MODE="gz" diff --git a/linux/scripts/pkgmk-test.sh b/linux/scripts/pkgmk-test.sh new file mode 100644 index 0000000..4cfe2c3 --- /dev/null +++ b/linux/scripts/pkgmk-test.sh @@ -0,0 +1,5 @@ +#!/bin/bash +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +CONF=${DIR}/pkgmk-test.conf +echo "pkgmk -cf $CONF -d -is $1" +fakeroot pkgmk -cf $CONF -d -is $1 diff --git a/linux/scripts/replace.sh b/linux/scripts/replace.sh new file mode 100755 index 0000000..8d5d8d9 --- /dev/null +++ b/linux/scripts/replace.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +# find and replace string on files +folder=$1 +oldstring=$2 +newstring=$3 + +#grep -rl $oldstring $folder | xargs sed -i s@$oldstring@$newstring@g +grep -rl "$oldstring" $folder | xargs sed -i "s@$oldstring@$newstring@g" diff --git a/linux/scripts/runvm/c12-dvd b/linux/scripts/runvm/c12-dvd new file mode 100644 index 0000000..9cbf201 --- /dev/null +++ b/linux/scripts/runvm/c12-dvd @@ -0,0 +1,15 @@ +export QEMU_AUDIO_DRV=alsa + +memory=1024 + +boot=c + +iso=iso/devuan_jessie_1.0.0_amd64_CD.iso + +image=img/c12-dvd.qcow2 + +tap="tap2" + +mac="54:60:be:ef:5c:72" + +other="-soundhw hda -vga std -display sdl -usb -device usb-ehci -device usb-host,vendorid=0x13d3,productid=0x5652" diff --git a/linux/scripts/runvm/profile/crux b/linux/scripts/runvm/profile/crux new file mode 100644 index 0000000..672b80d --- /dev/null +++ b/linux/scripts/runvm/profile/crux @@ -0,0 +1,7 @@ +mac="54:60:be:ef:5c:64" +memory=1024 +boot=$2 +tap="tap4" +iso=iso/crux-3.4.iso +image=img/c14.qcow2 +other="-vga std -display sdl" diff --git a/linux/scripts/runvm/runvm.sh b/linux/scripts/runvm/runvm.sh new file mode 100644 index 0000000..21cd097 --- /dev/null +++ b/linux/scripts/runvm/runvm.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +function rmac_addr (){ +printf '54:60:BE:EF:%02X:%02X\n' $((RANDOM%256)) $((RANDOM%256)) +} + +source profile/$1 + +#mac=$(rmac_addr) +#memory=1024 +#boot=d +#tap="tap1" +#iso=iso/crux-3.4.iso +#image=img/crux-standard.qcow2 +#other="-soundhw hda -vga std -display sdl" + +qemu-system-x86_64 \ + -enable-kvm \ + -m ${memory} \ + -boot ${boot} \ + -cdrom ${iso} \ + -hda ${image} \ + -device e1000,netdev=t0,mac=${mac} \ + -netdev tap,id=t0,ifname=${tap},script=no,downscript=no \ + ${other} \ + & diff --git a/linux/scripts/setup-gitolite.sh b/linux/scripts/setup-gitolite.sh new file mode 100644 index 0000000..c42db14 --- /dev/null +++ b/linux/scripts/setup-gitolite.sh @@ -0,0 +1,43 @@ +#!/bin/sh + +# First we define the function +ConfirmOrExit () +{ + while true + do + echo -n "Please confirm (y or n) :" + read CONFIRM + case $CONFIRM in + y|Y|YES|yes|Yes) break ;; + n|N|no|NO|No) + echo "Aborting - you entered $CONFIRM" + exit + ;; + *) echo "Please enter only y or n" + esac + done + echo "You entered $CONFIRM. Continuing ..." +} + + +# Absolute path to this script, e.g. /home/user/bin/foo.sh +SCRIPT=$(readlink -f "$0") +# Absolute path this script is in, thus /home/user/bin +SCRIPTPATH=$(dirname "$SCRIPT") + +DIR=$(dirname "$SCRIPTPATH"); +DIR_CONF=$DIR"/conf" + +echo "SCRIPT=$SCRIPT"; +echo "SCRIPTPATH=$SCRIPTPATH"; +echo "DIR=$DIR"; +echo "DIR_CONF=$DIR_CONF"; +ConfirmOrExit + + prt-get depinst gitolite + + mkdir -p /srv/gitolite + useradd -U -d /srv/gitolite gitolite + chown gitolite:gitolite /srv/gitolite + +exit 0; diff --git a/linux/scripts/setup-nginx.sh b/linux/scripts/setup-nginx.sh new file mode 100644 index 0000000..11065d2 --- /dev/null +++ b/linux/scripts/setup-nginx.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +#. `dirname $0`/config-install.sh +# +#prt-get depinst nginx +# +#cp -R $CONF_DIR/etc/nginx/* /etc/nginx/ +# +#mkdir /srv/www +#chown www:www /srv/www +# +#usermod -a -g www nginx +#usermod -m -d /srv/www nginx + +openssl genrsa -des3 -out /etc/ssl/keys/nginx.key 2048 +openssl req -new -key /etc/ssl/keys/nginx.key -out /etc/ssl/certs/nginx.csr +openssl x509 -req -days 365 \ + -in /etc/ssl/certs/nginx.csr \ + -signkey /etc/ssl/keys/nginx.key \ + -out /etc/ssl/certs/nginx.crt + +cp /etc/ssl/keys/nginx.key /etc/ssl/keys/nginx.key.pass +openssl rsa -in /etc/ssl/keys/nginx.key.pass -out /etc/ssl/keys/nginx.key + diff --git a/linux/scripts/setup-openssh.sh b/linux/scripts/setup-openssh.sh new file mode 100644 index 0000000..14afe8b --- /dev/null +++ b/linux/scripts/setup-openssh.sh @@ -0,0 +1,43 @@ +#!/bin/sh + +# First we define the function +ConfirmOrExit () +{ + while true + do + echo -n "Please confirm (y or n) :" + read CONFIRM + case $CONFIRM in + y|Y|YES|yes|Yes) break ;; + n|N|no|NO|No) + echo "Aborting - you entered $CONFIRM" + exit + ;; + *) echo "Please enter only y or n" + esac + done + echo "You entered $CONFIRM. Continuing ..." +} + + +# Absolute path to this script, e.g. /home/user/bin/foo.sh +SCRIPT=$(readlink -f "$0") +# Absolute path this script is in, thus /home/user/bin +SCRIPTPATH=$(dirname "$SCRIPT") + +DIR=$(dirname "$SCRIPTPATH"); +DIR_CONF=$DIR"/conf" + +echo "SCRIPT=$SCRIPT"; +echo "SCRIPTPATH=$SCRIPTPATH"; +echo "DIR=$DIR"; +echo "DIR_CONF=$DIR_CONF"; +ConfirmOrExit + + + #installer overwrite system init script + cp -R $DIR_CONF/etc/ssh/sshd_config /etc/ssh/sshd_config + + sh /etc/rc.d/sshd start + +exit 0; diff --git a/linux/scripts/setup-php.sh b/linux/scripts/setup-php.sh new file mode 100644 index 0000000..4c28173 --- /dev/null +++ b/linux/scripts/setup-php.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +. `dirname $0`/config-install.sh + +prt-get depinst php php-fpm php-gd php-pdo-pgsql php-postgresql + +cp /etc/php/php.ini-development /etc/php/php.ini diff --git a/linux/scripts/setup-postgresql.sh b/linux/scripts/setup-postgresql.sh new file mode 100644 index 0000000..4e1ee3a --- /dev/null +++ b/linux/scripts/setup-postgresql.sh @@ -0,0 +1,87 @@ +#!/bin/sh + +# First we define the function +ConfirmOrExit () +{ + while true + do + echo -n "Please confirm (y or n) :" + read CONFIRM + case $CONFIRM in + y|Y|YES|yes|Yes) break ;; + n|N|no|NO|No) + echo "Aborting - you entered $CONFIRM" + exit + ;; + *) echo "Please enter only y or n" + esac + done + echo "You entered $CONFIRM. Continuing ..." +} + + +# Absolute path to this script, e.g. /home/user/bin/foo.sh +SCRIPT=$(readlink -f "$0") +# Absolute path this script is in, thus /home/user/bin +SCRIPTPATH=$(dirname "$SCRIPT") + +DIR=$(dirname "$SCRIPTPATH"); +DIR_CONF=$DIR"/conf" + +echo "SCRIPT=$SCRIPT"; +echo "SCRIPTPATH=$SCRIPTPATH"; +echo "DIR=$DIR"; +echo "DIR_CONF=$DIR_CONF"; +ConfirmOrExit + +IS_INSTALL=$(prt-get isinst postgresql); +echo $IS_INSTALL; +if [ "$IS_INSTALL" = "package postgresql is installed" ] +then + echo "updating postgresql" + OLD_VERSION=$(prt-get current postgresql); + echo $OLD_VERSION; + + sudo -u postgres pg_dumpall > /srv/pgsql/dump-$OLD_VERSION.sql + + sh /etc/rc.d/postgresql stop + + #extra backup, in case ... + tar --xattrs -zcpf /srv/pgsql/data-$OLD_VERSION.tar.gz \ + --directory=/srv/pgsql/data . + + rm -R /srv/pgsql/data + + prt-get update postgresql + + NEW_VERSION=$(prt-get current postgresql); + echo $NEW_VERSION; + + sudo -u postgres initdb -D /srv/pgsql/data + + rejmerge + #installer overwrite system init script + cp -R $DIR_CONF/etc/rc.d/postgresql /etc/rc.d/ + + sh /etc/rc.d/postgresql start + sleep 5 + + sudo -u postgres psql -d postgres -f /srv/pgsql/dump-$OLD_VERSION.sql + +else + echo "install postgresql and dependencies" + prt-get depinst postgresql + + cp -R $DIR_CONF/etc/rc.d/postgresql /etc/rc.d/ + + mkdir /srv/pgsql/ + touch /var/log/postgresql + chown postgres:postgres /srv/pgsql /var/log/postgresql + + sudo -u postgres initdb -D /srv/pgsql/data + + cp $DIR_CONF/srv/pgsql/data/pg_hba.conf /srv/pgsql/data/ + chown postgres:postgres /srv/pgsql/data/pg_hba.conf +fi + +exit 0; diff --git a/linux/scripts/setup-x.sh b/linux/scripts/setup-x.sh new file mode 100644 index 0000000..262b4dd --- /dev/null +++ b/linux/scripts/setup-x.sh @@ -0,0 +1,96 @@ +#!/bin/bash + +# Absolute path to this script, e.g. /home/user/bin/foo.sh +SCRIPT=$(readlink -f "$0") +# Absolute path this script is in, thus /home/user/bin +SCRIPTPATH=$(dirname "$SCRIPT") + +DIR=$(dirname "$SCRIPTPATH"); +DIR_CONF=$DIR"/conf" + + + +prt-get depinst xorg-server \ + xorg-xinit \ + xorg-xrdb \ + xorg-xdpyinfo \ + xorg-xauth \ + xorg-xmodmap \ + xorg-xrandr \ + xorg-xgamma \ + xorg-xf86-input-evdev \ + xorg-xf86-input-synaptics \ + xsel \ + xkeyboard-config + +prt-get depinst xorg-font-util \ + xorg-font-alias \ + xorg-font-dejavu-ttf \ + xorg-font-cursor-misc \ + xorg-font-misc-misc \ + console-font-terminus \ + xorg-font-terminus \ + xorg-font-mutt-misc + +prt-get search xorg-font-bitstream | xargs sudo prt-get depinst +prt-get search xorg-font-bh | xargs sudo prt-get depinst + +#prt-get search otf- | xargs sudo prt-get depinst +#prt-get depinst otf-sourcecode + +prt-get depinst \ + alsa-utils \ + libdrm \ + mesa3d \ + ffmpeg \ + gstreamer \ + gstreamer-vaapi \ + gst-plugins-base \ + gst-plugins-good \ + gst-plugins-bad \ + gst-plugins-ugly \ + cmus \ + dmenu \ + st \ + gparted \ + gimp \ + libreoffice \ + ca-certificates \ + linux-pam \ + gstreamer \ + libgd \ + icu \ + syndaemon \ + firefox + +prt-get depinst \ + openbox \ + dwm \ + spectrwm \ + mate + +ConfirmOrExit () { + while true + do + echo -n "Please confirm (y or n) :" + read CONFIRM + case $CONFIRM in + y|Y|YES|yes|Yes) break ;; + n|N|no|NO|No) + echo "Aborting - you entered $CONFIRM" + exit + ;; + *) echo "Please enter only y or n" + esac + done + echo "You entered $CONFIRM. Continuing ..." +} + +echo "SCRIPT=$SCRIPT"; +echo "SCRIPTPATH=$SCRIPTPATH"; +echo "DIR=$DIR"; +echo "DIR_CONF=$DIR_CONF"; +ConfirmOrExit + +cp -R $DIR_CONF/etc/X11/* /etc/X11/ + diff --git a/tools/scripts/mirror-system b/tools/scripts/mirror-system deleted file mode 100755 index 6c8a528..0000000 --- a/tools/scripts/mirror-system +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/bash - -if [ -f /tmp/mirror ]; then - echo "mirror system is already running" - exit 0 -fi - -touch /tmp/mirror - -#BUILD_NAME="R2D9" -#BUILD_TITLE="${BUILD_NAME}-$(cat /usr/ports/releases/stable/metadata/build-version)" -BUILD_TITLE="Crux 3.6" - -# Update system -ports -u - -# make them look like updated -echo "touch packages..." -for package in /usr/ports/packages/*; do - touch ${package}; -done - -# make sure permissions are right -echo "chown pkgmk:pkgmk -R /usr/ports" -chown pkgmk:pkgmk -R /usr/ports - -echo "update system" -prt-get depinst $(prt-get listinst | xargs prt-get quickdep) -prt-get sysup -prt-get update -fr $(revdep) - -# Create list of installed packages -echo "creating list of installed..." -rm -r /usr/ports/installed -pkg_installed - -### clean distribution files -mkdir -p /usr/ports/archive/distfiles -mv /usr/ports/distfiles/* /usr/ports/archive/distfiles -### clean packages files -mkdir -p /usr/ports/archive/packages -mv /usr/ports/packages/* /usr/ports/archive/packages -### get sources and packages -cd /usr/ports/installed -for installed in *; do - prt-get path $installed | while read -r line; do - cd $line - ##get source - sudo -u pkgmk -g pkgmk pkgmk -do - #make sure package exists - current="${installed}#$(prt-get current ${installed}).pkg.tar.gz" - echo "checking $current ..." - cp /usr/ports/archive/packages/${current} /usr/ports/packages/ - #prt-get update $installed - done -done - -# Create repository -echo "creating repository" -cd /usr/ports/packages -pkg-repgen - -# Create mirror page -echo "creating mirror index page" -portspage --title=${BUILD_TITLE} /usr/ports/installed > /usr/ports/installed/index.html - -sed -i "s@usr\/ports\/installed@mirror/installed@g" /usr/ports/installed/index.html - -echo "setting permissions /usr/ports" -chown pkgmk:pkgmk -R /usr/ports - -# Remove temporary file -rm /tmp/mirror diff --git a/tools/scripts/pkgmk-test.conf b/tools/scripts/pkgmk-test.conf deleted file mode 100644 index 4a04eec..0000000 --- a/tools/scripts/pkgmk-test.conf +++ /dev/null @@ -1,19 +0,0 @@ -# -# /etc/pkgmk.conf: pkgmk(8) configuration -# - -source /etc/pkgmk.conf - -#PKGMK_SOURCE_MIRRORS=(http://c1.ank/distfiles/) -PKGMK_SOURCE_DIR="$PWD" -PKGMK_PACKAGE_DIR="$PWD" -PKGMK_WORK_DIR="$PWD/work" -PKGMK_DOWNLOAD="yes" -PKGMK_UP_TO_DATE="no" -# PKGMK_IGNORE_FOOTPRINT="no" -# PKGMK_IGNORE_NEW="no" -# PKGMK_NO_STRIP="no" -# PKGMK_DOWNLOAD_PROG="wget" -# PKGMK_WGET_OPTS="" -# PKGMK_CURL_OPTS="" -# PKGMK_COMPRESSION_MODE="gz" diff --git a/tools/scripts/pkgmk-test.sh b/tools/scripts/pkgmk-test.sh deleted file mode 100644 index 4cfe2c3..0000000 --- a/tools/scripts/pkgmk-test.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -CONF=${DIR}/pkgmk-test.conf -echo "pkgmk -cf $CONF -d -is $1" -fakeroot pkgmk -cf $CONF -d -is $1 diff --git a/tools/scripts/replace.sh b/tools/scripts/replace.sh deleted file mode 100755 index 8d5d8d9..0000000 --- a/tools/scripts/replace.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -# find and replace string on files -folder=$1 -oldstring=$2 -newstring=$3 - -#grep -rl $oldstring $folder | xargs sed -i s@$oldstring@$newstring@g -grep -rl "$oldstring" $folder | xargs sed -i "s@$oldstring@$newstring@g" diff --git a/tools/scripts/runvm/c12-dvd b/tools/scripts/runvm/c12-dvd deleted file mode 100644 index 9cbf201..0000000 --- a/tools/scripts/runvm/c12-dvd +++ /dev/null @@ -1,15 +0,0 @@ -export QEMU_AUDIO_DRV=alsa - -memory=1024 - -boot=c - -iso=iso/devuan_jessie_1.0.0_amd64_CD.iso - -image=img/c12-dvd.qcow2 - -tap="tap2" - -mac="54:60:be:ef:5c:72" - -other="-soundhw hda -vga std -display sdl -usb -device usb-ehci -device usb-host,vendorid=0x13d3,productid=0x5652" diff --git a/tools/scripts/runvm/profile/crux b/tools/scripts/runvm/profile/crux deleted file mode 100644 index 672b80d..0000000 --- a/tools/scripts/runvm/profile/crux +++ /dev/null @@ -1,7 +0,0 @@ -mac="54:60:be:ef:5c:64" -memory=1024 -boot=$2 -tap="tap4" -iso=iso/crux-3.4.iso -image=img/c14.qcow2 -other="-vga std -display sdl" diff --git a/tools/scripts/runvm/runvm.sh b/tools/scripts/runvm/runvm.sh deleted file mode 100644 index 21cd097..0000000 --- a/tools/scripts/runvm/runvm.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -function rmac_addr (){ -printf '54:60:BE:EF:%02X:%02X\n' $((RANDOM%256)) $((RANDOM%256)) -} - -source profile/$1 - -#mac=$(rmac_addr) -#memory=1024 -#boot=d -#tap="tap1" -#iso=iso/crux-3.4.iso -#image=img/crux-standard.qcow2 -#other="-soundhw hda -vga std -display sdl" - -qemu-system-x86_64 \ - -enable-kvm \ - -m ${memory} \ - -boot ${boot} \ - -cdrom ${iso} \ - -hda ${image} \ - -device e1000,netdev=t0,mac=${mac} \ - -netdev tap,id=t0,ifname=${tap},script=no,downscript=no \ - ${other} \ - & diff --git a/tools/scripts/setup-gitolite.sh b/tools/scripts/setup-gitolite.sh deleted file mode 100644 index c42db14..0000000 --- a/tools/scripts/setup-gitolite.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/sh - -# First we define the function -ConfirmOrExit () -{ - while true - do - echo -n "Please confirm (y or n) :" - read CONFIRM - case $CONFIRM in - y|Y|YES|yes|Yes) break ;; - n|N|no|NO|No) - echo "Aborting - you entered $CONFIRM" - exit - ;; - *) echo "Please enter only y or n" - esac - done - echo "You entered $CONFIRM. Continuing ..." -} - - -# Absolute path to this script, e.g. /home/user/bin/foo.sh -SCRIPT=$(readlink -f "$0") -# Absolute path this script is in, thus /home/user/bin -SCRIPTPATH=$(dirname "$SCRIPT") - -DIR=$(dirname "$SCRIPTPATH"); -DIR_CONF=$DIR"/conf" - -echo "SCRIPT=$SCRIPT"; -echo "SCRIPTPATH=$SCRIPTPATH"; -echo "DIR=$DIR"; -echo "DIR_CONF=$DIR_CONF"; -ConfirmOrExit - - prt-get depinst gitolite - - mkdir -p /srv/gitolite - useradd -U -d /srv/gitolite gitolite - chown gitolite:gitolite /srv/gitolite - -exit 0; diff --git a/tools/scripts/setup-nginx.sh b/tools/scripts/setup-nginx.sh deleted file mode 100644 index 11065d2..0000000 --- a/tools/scripts/setup-nginx.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - -#. `dirname $0`/config-install.sh -# -#prt-get depinst nginx -# -#cp -R $CONF_DIR/etc/nginx/* /etc/nginx/ -# -#mkdir /srv/www -#chown www:www /srv/www -# -#usermod -a -g www nginx -#usermod -m -d /srv/www nginx - -openssl genrsa -des3 -out /etc/ssl/keys/nginx.key 2048 -openssl req -new -key /etc/ssl/keys/nginx.key -out /etc/ssl/certs/nginx.csr -openssl x509 -req -days 365 \ - -in /etc/ssl/certs/nginx.csr \ - -signkey /etc/ssl/keys/nginx.key \ - -out /etc/ssl/certs/nginx.crt - -cp /etc/ssl/keys/nginx.key /etc/ssl/keys/nginx.key.pass -openssl rsa -in /etc/ssl/keys/nginx.key.pass -out /etc/ssl/keys/nginx.key - diff --git a/tools/scripts/setup-openssh.sh b/tools/scripts/setup-openssh.sh deleted file mode 100644 index 14afe8b..0000000 --- a/tools/scripts/setup-openssh.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/sh - -# First we define the function -ConfirmOrExit () -{ - while true - do - echo -n "Please confirm (y or n) :" - read CONFIRM - case $CONFIRM in - y|Y|YES|yes|Yes) break ;; - n|N|no|NO|No) - echo "Aborting - you entered $CONFIRM" - exit - ;; - *) echo "Please enter only y or n" - esac - done - echo "You entered $CONFIRM. Continuing ..." -} - - -# Absolute path to this script, e.g. /home/user/bin/foo.sh -SCRIPT=$(readlink -f "$0") -# Absolute path this script is in, thus /home/user/bin -SCRIPTPATH=$(dirname "$SCRIPT") - -DIR=$(dirname "$SCRIPTPATH"); -DIR_CONF=$DIR"/conf" - -echo "SCRIPT=$SCRIPT"; -echo "SCRIPTPATH=$SCRIPTPATH"; -echo "DIR=$DIR"; -echo "DIR_CONF=$DIR_CONF"; -ConfirmOrExit - - - #installer overwrite system init script - cp -R $DIR_CONF/etc/ssh/sshd_config /etc/ssh/sshd_config - - sh /etc/rc.d/sshd start - -exit 0; diff --git a/tools/scripts/setup-php.sh b/tools/scripts/setup-php.sh deleted file mode 100644 index 4c28173..0000000 --- a/tools/scripts/setup-php.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -. `dirname $0`/config-install.sh - -prt-get depinst php php-fpm php-gd php-pdo-pgsql php-postgresql - -cp /etc/php/php.ini-development /etc/php/php.ini diff --git a/tools/scripts/setup-postgresql.sh b/tools/scripts/setup-postgresql.sh deleted file mode 100644 index 4e1ee3a..0000000 --- a/tools/scripts/setup-postgresql.sh +++ /dev/null @@ -1,87 +0,0 @@ -#!/bin/sh - -# First we define the function -ConfirmOrExit () -{ - while true - do - echo -n "Please confirm (y or n) :" - read CONFIRM - case $CONFIRM in - y|Y|YES|yes|Yes) break ;; - n|N|no|NO|No) - echo "Aborting - you entered $CONFIRM" - exit - ;; - *) echo "Please enter only y or n" - esac - done - echo "You entered $CONFIRM. Continuing ..." -} - - -# Absolute path to this script, e.g. /home/user/bin/foo.sh -SCRIPT=$(readlink -f "$0") -# Absolute path this script is in, thus /home/user/bin -SCRIPTPATH=$(dirname "$SCRIPT") - -DIR=$(dirname "$SCRIPTPATH"); -DIR_CONF=$DIR"/conf" - -echo "SCRIPT=$SCRIPT"; -echo "SCRIPTPATH=$SCRIPTPATH"; -echo "DIR=$DIR"; -echo "DIR_CONF=$DIR_CONF"; -ConfirmOrExit - -IS_INSTALL=$(prt-get isinst postgresql); -echo $IS_INSTALL; -if [ "$IS_INSTALL" = "package postgresql is installed" ] -then - echo "updating postgresql" - OLD_VERSION=$(prt-get current postgresql); - echo $OLD_VERSION; - - sudo -u postgres pg_dumpall > /srv/pgsql/dump-$OLD_VERSION.sql - - sh /etc/rc.d/postgresql stop - - #extra backup, in case ... - tar --xattrs -zcpf /srv/pgsql/data-$OLD_VERSION.tar.gz \ - --directory=/srv/pgsql/data . - - rm -R /srv/pgsql/data - - prt-get update postgresql - - NEW_VERSION=$(prt-get current postgresql); - echo $NEW_VERSION; - - sudo -u postgres initdb -D /srv/pgsql/data - - rejmerge - #installer overwrite system init script - cp -R $DIR_CONF/etc/rc.d/postgresql /etc/rc.d/ - - sh /etc/rc.d/postgresql start - sleep 5 - - sudo -u postgres psql -d postgres -f /srv/pgsql/dump-$OLD_VERSION.sql - -else - echo "install postgresql and dependencies" - prt-get depinst postgresql - - cp -R $DIR_CONF/etc/rc.d/postgresql /etc/rc.d/ - - mkdir /srv/pgsql/ - touch /var/log/postgresql - chown postgres:postgres /srv/pgsql /var/log/postgresql - - sudo -u postgres initdb -D /srv/pgsql/data - - cp $DIR_CONF/srv/pgsql/data/pg_hba.conf /srv/pgsql/data/ - chown postgres:postgres /srv/pgsql/data/pg_hba.conf -fi - -exit 0; diff --git a/tools/scripts/setup-x.sh b/tools/scripts/setup-x.sh deleted file mode 100644 index 262b4dd..0000000 --- a/tools/scripts/setup-x.sh +++ /dev/null @@ -1,96 +0,0 @@ -#!/bin/bash - -# Absolute path to this script, e.g. /home/user/bin/foo.sh -SCRIPT=$(readlink -f "$0") -# Absolute path this script is in, thus /home/user/bin -SCRIPTPATH=$(dirname "$SCRIPT") - -DIR=$(dirname "$SCRIPTPATH"); -DIR_CONF=$DIR"/conf" - - - -prt-get depinst xorg-server \ - xorg-xinit \ - xorg-xrdb \ - xorg-xdpyinfo \ - xorg-xauth \ - xorg-xmodmap \ - xorg-xrandr \ - xorg-xgamma \ - xorg-xf86-input-evdev \ - xorg-xf86-input-synaptics \ - xsel \ - xkeyboard-config - -prt-get depinst xorg-font-util \ - xorg-font-alias \ - xorg-font-dejavu-ttf \ - xorg-font-cursor-misc \ - xorg-font-misc-misc \ - console-font-terminus \ - xorg-font-terminus \ - xorg-font-mutt-misc - -prt-get search xorg-font-bitstream | xargs sudo prt-get depinst -prt-get search xorg-font-bh | xargs sudo prt-get depinst - -#prt-get search otf- | xargs sudo prt-get depinst -#prt-get depinst otf-sourcecode - -prt-get depinst \ - alsa-utils \ - libdrm \ - mesa3d \ - ffmpeg \ - gstreamer \ - gstreamer-vaapi \ - gst-plugins-base \ - gst-plugins-good \ - gst-plugins-bad \ - gst-plugins-ugly \ - cmus \ - dmenu \ - st \ - gparted \ - gimp \ - libreoffice \ - ca-certificates \ - linux-pam \ - gstreamer \ - libgd \ - icu \ - syndaemon \ - firefox - -prt-get depinst \ - openbox \ - dwm \ - spectrwm \ - mate - -ConfirmOrExit () { - while true - do - echo -n "Please confirm (y or n) :" - read CONFIRM - case $CONFIRM in - y|Y|YES|yes|Yes) break ;; - n|N|no|NO|No) - echo "Aborting - you entered $CONFIRM" - exit - ;; - *) echo "Please enter only y or n" - esac - done - echo "You entered $CONFIRM. Continuing ..." -} - -echo "SCRIPT=$SCRIPT"; -echo "SCRIPTPATH=$SCRIPTPATH"; -echo "DIR=$DIR"; -echo "DIR_CONF=$DIR_CONF"; -ConfirmOrExit - -cp -R $DIR_CONF/etc/X11/* /etc/X11/ - -- cgit 1.4.1-2-gfad0