From: xf0r3m Date: Mon, 25 May 2026 11:20:47 +0000 (+0200) Subject: Próba wdrożenia bash-completion dla narzędzi autorskich immudex cz.1 X-Git-Url: https://gitweb.morketsmerke.org/?a=commitdiff_plain;h=0fa60bb5b673b81c70e07e1fc82a5149e45ab6c6;p=immudex.git Próba wdrożenia bash-completion dla narzędzi autorskich immudex cz.1 --- diff --git a/immudex-complete-project/immudex-branch b/immudex-complete-project/immudex-branch deleted file mode 100755 index 3c49dc2..0000000 --- a/immudex-complete-project/immudex-branch +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash - -function help() { - echo "immudex-branch it's a conky helper script, which returns Debian version"; - echo "used for build immudex. This information is used in 'Info:' section"; - echo "in conky widget as complement in name of immudex version."; - echo; - echo "Usage: immudex-branch [-h] [-v]"; - echo; - echo "Options:"; - echo " -h Print this message."; - echo " -v Print information about version, author and copyrights."; - echo; - echo "Examples:"; - echo " immudex-branch Prints version of Debian used for immudex build with hyphen on start of." - echo " immudex-branch -h Prints this message."; - echo " immudex-branch -v Print information about version, author and copyrights."; - echo; - echo "Report bugs to "; -} - -function version() { - echo "immudex-branch 1.1"; - echo; - echo "Copyright (C) 2026 morketsmerke.org"; - echo "This is free software; see the source for copying conditions. There is NO"; - echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."; - echo; - echo "Written by xf0r3m."; - -} - -if [ "$1" ]; then - if [ "$1" = "-h" ]; then - help; - elif [ "$1" = "-v" ]; then - version; - fi -else - if grep -q 'forky' /etc/os-release; then - echo -n '-testing'; - elif grep -q 'trixie' /etc/os-release; then - echo -n '-stable'; - else - echo -n '-oldstable'; - fi -fi diff --git a/immudex-complete-project/immudex-branch.1.gz b/immudex-complete-project/immudex-branch.1.gz deleted file mode 100644 index 9ef8180..0000000 Binary files a/immudex-complete-project/immudex-branch.1.gz and /dev/null differ diff --git a/immudex-complete-project/immudex-cdrip b/immudex-complete-project/immudex-cdrip deleted file mode 100755 index 5b54966..0000000 --- a/immudex-complete-project/immudex-cdrip +++ /dev/null @@ -1,148 +0,0 @@ -#!/bin/bash - -function XMLScrap() { - echo -n $(grep -o "<${1}>.*" $2 \ - | sed "s,<${1}>,," \ - | sed "s,,," \ - | sed 's,&,and,g'); -} - -function help() { - echo "immudex-cdrip it's a bash script for collect audio tracks from Audio CD's."; - echo "Script apart form ripping Audio CD's, reads metadata, check it on music"; - echo "databases and creates properly named directories and audio files."; - echo; - echo "Usage: immudex-cdrip [-g] [-h] [-o] [-r] [-v]"; - echo; - echo "Options:"; - echo " -g Getting metadata from Audio CD without ripping."; - echo " -h Print this message."; - echo " -o Rips audio tracks from Audio CD, without renaming based Audio CD metadata"; - echo " -r Rips audio tracks from Audio CD, create Artist/Album folders and rename tracks according to AudioCD metadata."; - echo " -v Print information about version, author and copyrights."; - echo; - echo "Examples:"; - echo " immudex-cdrip Print this message"; - echo " immudex-cdrip -g Get metadata from Audio CD"; - echo " immudex-cdrip -o Rip tracks form Audio CD, without renaming. Could be useful with less popular artists."; - echo " immudex-cdrip -r Rips Audio CD and names dirs and files with Audio CD data."; - echo; - echo "Report bugs to "; -} - -function version() { - echo "immudex-cdrip 1.1"; - echo; - echo "Copyright (C) 2026 morketsmerke.org"; - echo "This is free software; see the source for copying conditions. There is NO"; - echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."; - echo; - echo "Written by xf0r3m."; -} - -function multipleArtistDisc() { - - FILE="$1"; - ARTIST="VA"; - ALBUM=$(XMLScrap "Title" $FILE); - NUMTRACKS=$(XMLScrap "NumTracks" $FILE); - TRACKPATH="${ARTIST} - ${ALBUM}"; - - mkdir -vp "${TRACKPATH}"; - - i=1; - while [ $i -le $NUMTRACKS ]; do - artist=$(grep -o ".*" $FILE \ - | sed -n "${i}p" \ - | sed 's,,,' \ - | sed 's,,,'); - - trackName=$(grep -o ".*" $FILE \ - | sed -n "${i}p" \ - | sed 's,,,' \ - | sed 's,,,'); - - if [ $i -lt 10 ]; then - trackNumber="0${i}"; - else - trackNumber=${i}; - fi - - audioFilename="audio_${trackNumber}.wav"; - infFilename=$(echo $audioFilename | sed 's/wav/inf/'); - - mv -v $audioFilename "${TRACKPATH}/${trackNumber}. ${artist} - ${trackName}.wav"; - rm -v ${infFilename}; - i=$(expr $i + 1); - done - - rm -v audio.cddb; - rm -v ${FILE}; -} - -#if [ ! -x /usr/bin/cdda2wav ]; then -# exit 1; -#fi - -if [ "$1" ] && [ "$1" = "--rip-only" ]; then - cdda2wav -vall cddb=-1 speed=4 -paranoia paraopts=no-verify -B -D /dev/sr0; - exit 0; -fi - -if [ "$1" ] && [ "$1" = "--get-disc-info" ]; then - cdda2wav -J -D /dev/sr0; - exit 0; -fi - -if [ "$1" ] && [ "$1" = "--rip-n-rename" ]; then - cdda2wav -vall cddb=1 speed=4 -paranoia paraopts=no-verify -B -D /dev/sr0; - - FILE="audio.cdindex"; - - if $(grep -q '' $FILE); then - multipleArtistDisc $FILE; - else - ARTIST=$(XMLScrap "Artist" $FILE); - ALBUM=$(XMLScrap "Title" $FILE); - NUMTRACKS=$(XMLScrap "NumTracks" $FILE); - TRACKPATH="${ARTIST}/${ALBUM}"; - - mkdir -vp "${TRACKPATH}"; - - i=1; - while [ $i -le $NUMTRACKS ]; do - trackName=$(grep -o ".*" $FILE \ - | sed -n "${i}p" \ - | sed 's,,,' \ - | sed 's,,,'); - - if [ $i -lt 10 ]; then - audioFilename="audio_0${i}.wav"; - trackNumber="0${i}"; - else - audioFilename="audio_${i}.wav"; - trackNumber="${i}"; - fi - infFilename=$(echo "$audioFilename" | sed 's/wav/inf/'); - mv -v $audioFilename "${TRACKPATH}/${trackNumber}. ${ARTIST} - ${trackName}.wav"; - rm -v $infFilename; - i=$(expr $i + 1); - done - - rm -v audio.cddb; - rm -v audio.cdindex; - fi - exit 0; -fi - -if [ "$1" ] && [ "$1" = "-h" ]; then - help; - exit 0; -fi - -if [ "$1" ] && [ "$1" = "-v" ]; then - version; - exit 0; -fi - -help; diff --git a/immudex-complete-project/immudex-cdrip.1.gz b/immudex-complete-project/immudex-cdrip.1.gz deleted file mode 100644 index 5a16bb8..0000000 Binary files a/immudex-complete-project/immudex-cdrip.1.gz and /dev/null differ diff --git a/immudex-complete-project/immudex-complete-functions b/immudex-complete-project/immudex-complete-functions deleted file mode 100644 index 5edfe2c..0000000 --- a/immudex-complete-project/immudex-complete-functions +++ /dev/null @@ -1,255 +0,0 @@ -#!/bin/bash - -#immudex-branch, #immudex-hostname, #immudex-import-gpgkeys, #immudex-motd, -#immudex-padlock, #immudex-run, #immudex-secured-firefox, #immudex-secured-librewolf -#immudex-version, -idx_simple_options_complete() { - local cur; - - COMPREPLY=(); - cur=${COMP_WORDS[COMP_CWORD]}; - - if [ $COMP_CWORD -eq 1 ]; then - COMPREPLY=( $(compgen -W '-h -v' -- $cur) ); - elif [ $COMP_CWORD -eq 2 ]; then - return 0; - fi - return 0; -} - -#immudex-cdrip -idx_cdrip_complete() { - local cur; - - COMPREPLY=() - cur=${COMP_WORDS[COMP_CWORD]}; - - if [ $COMP_CWORD -eq 1 ]; then - COMPREPLY=( $(compgen -W '-g -h -o -r -v' -- $cur) ); - elif [ $COMP_CWORD -eq 2 ]; then - return 0; - fi - return 0; -} - -#immudex-create-media -disk_list() { - i=0; - diskList=(); - for disk in $(ls -l /dev/ | grep 'disk' | grep '\ 0\ ' | awk '{printf $NF" "}'); do - diskList[$i]="/dev/${disk}"; - i=$(expr $i + 1); - done - echo -n ${diskList[@]}; -} - - -idx_create_media_complete() { - local cur prev - - COMPREPLY=() - cur=${COMP_WORDS[COMP_CWORD]}; - prev=${COMP_WORDS[COMP_CWORD-1]}; - - if [ $COMP_CWORD -eq 1 ]; then - COMPREPLY=( $(compgen -W '-e32 -h -l -n -v' -- $cur) ); - elif [ $COMP_CWORD -eq 2 ]; then - case "$prev" in - '-e32' | '-l') COMPREPLY=( $(compgen -f -X "!*.iso" -- $cur) );; - '-n') COMPREPLY=( $(compgen -W "$(disk_list)" -- $cur) );; - *) return 0;; - esac - elif [ $COMP_CWORD -eq 3 ]; then - case "$prev" in - *.iso) COMPREPLY=( $(compgen -W "$(disk_list)" -- $cur) );; - *) return 0;; - esac - fi - return 0 -} - -#immudex-crypt -return_ic_index() { - echo -n "$(ls /dev/mapper | grep 'immudex-crypt[0-9]*' | grep -o '[0-9]*' | awk '{printf $1" " }')"; -} - -part_list() { - i=0; - partList=(); - for part in $(ls -l /dev/ | grep '^b' | grep -v '\ 0\ ' | grep -v 'dm' | awk '{printf $NF" "}'); do - partList[$i]="/dev/${part}"; - i=$(expr $i + 1); - done - echo -n ${partList[@]}; -} - -cryptDevice_list() { - echo -n "$(/usr/sbin/blkid | grep 'crypto_LUKS' | awk '{printf $1" "}' | sed 's/://g')"; -} - -idx_crypt_complete() { - local cur prev - - COMPREPLY=() - cur=${COMP_WORDS[COMP_CWORD]}; - prev=${COMP_WORDS[COMP_CWORD-1]} - - if [ $COMP_CWORD -eq 1 ]; then - COMPREPLY=( $(compgen -W '-c -f -h -l -o -v' -- $cur) ); - elif [ $COMP_CWORD -eq 2 ]; then - case "$prev" in - '-c') COMPREPLY=( $(compgen -W "$(return_ic_index)" -- $cur) );; - '-f') COMPREPLY=( $(compgen -W "$(part_list)" -- $cur) );; - '-o') COMPREPLY=( $(compgen -W "$(cryptDevice_list)" -- $cur) );; - *) return 0;; - esac - fi - return 0; -} - -#immudex-import-sshkeys -idx_import_sshkeys_complete() { - local cur; - - COMPREPLY=(); - cur=${COMP_WORDS[COMP_CWORD]}; - - if [ $COMP_CWORD -eq 1 ]; then - COMPREPLY=( $(compgen -W '-i -h -v' -- $cur) ); - elif [ $COMP_CWORD -eq 2 ]; then - return 0; - fi - return 0; - -} - -#immudex-install -idx_install_complete() { - local cur; - - COMPREPLY=(); - cur=${COMP_WORDS[COMP_CWORD]}; - - if [ $COMP_CWORD -eq 1 ]; then - COMPREPLY=( $(compgen -W '-h -p -v' -- $cur) ); - elif [ $COMP_CWORD -eq 2 ]; then - return 0; - fi - return 0; - -} - -#immudex-meteo -idx_meteo_complete() { -local cur prev - - COMPREPLY=() - cur=${COMP_WORDS[COMP_CWORD]}; - prev=${COMP_WORDS[COMP_CWORD-1]} - - if [ $COMP_CWORD -eq 1 ]; then - COMPREPLY=( $(compgen -W '-h -l -m -s -v' -- $cur) ); - elif [ $COMP_CWORD -eq 2 ]; then - case "$prev" in - '-l'|'-m'|'-s') - if [ -f /etc/motd.conf ]; then - source /etc/motd.conf; - COMPREPLY=( $(compgen -W "$LOCATION" -- $cur) ) - else - return 0; - fi - ;; - *) return 0;; - esac - fi - return 0; -} - -#immudex-morketsmerke -idx_morketsmerke_complete() { - local cur; - - COMPREPLY=(); - cur=${COMP_WORDS[COMP_CWORD]}; - - if [ $COMP_CWORD -eq 1 ]; then - COMPREPLY=( $(compgen -W '-b -h -v' -- $cur) ); - elif [ $COMP_CWORD -eq 2 ]; then - return 0; - fi - return 0; - -} - -#immudex-pl -idx_pl_complete() { - local cur; - - COMPREPLY=(); - cur=${COMP_WORDS[COMP_CWORD]}; - - if [ $COMP_CWORD -eq 1 ]; then - COMPREPLY=( $(compgen -W '-h -i -v' -- $cur) ); - elif [ $COMP_CWORD -eq 2 ]; then - return 0; - fi - return 0; - -} - -#immudex-shoutcasts -idx_shoutcasts_complete() { - local cur prev - - COMPREPLY=() - cur=${COMP_WORDS[COMP_CWORD]}; - prev=${COMP_WORDS[COMP_CWORD-1]} - - if [ $COMP_CWORD -eq 1 ]; then - COMPREPLY=( $(compgen -W '-s -k -h -v' -- $cur) ); - elif [ $COMP_CWORD -eq 2 ]; then - case "$prev" in - '-s') - COMPREPLY=( $(compgen -W "icecast radio" -- $cur) ) - ;; - *) return 0;; - esac - fi - return 0; -} - -#immudex-upgrade -idx_upgrade_complete() { - local cur; - - COMPREPLY=(); - cur=${COMP_WORDS[COMP_CWORD]}; - - if [ $COMP_CWORD -eq 1 ]; then - COMPREPLY=( $(compgen -W '-c -d -h -m -p -s -u -v' -- $cur) ); - elif [ $COMP_CWORD -eq 2 ]; then - return 0; - fi - return 0; - -} - -idx_ytplay_complete() { - local cur; - - COMPREPLY=(); - cur=${COMP_WORDS[COMP_CWORD]}; - prev=${COMP_WORDS[COMP_CWORD-2]}; - - if [ $COMP_CWORD -eq 1 ]; then - COMPREPLY=( $(compgen -W '-a -h -i -s -v' -- $cur) ); - elif [ $COMP_CWORD -eq 3 ]; then - case "$prev" in - '-s') COMPREPLY=( $(compgen -W '-a -v' -- $cur) );; - *) return 0;; - esac - fi - return 0; -} - - diff --git a/immudex-complete-project/immudex-create-media b/immudex-complete-project/immudex-create-media deleted file mode 100755 index c9bd76d..0000000 --- a/immudex-complete-project/immudex-create-media +++ /dev/null @@ -1,135 +0,0 @@ -#!/bin/bash - -GREEN="\e[32m"; -YELLOW="\e[33m"; -ENDCOLOR="\e[0m"; - -function help() { - echo "immudex-create-media it's script used for write iso image to usb drive."; - echo "Script writes .iso file to usb stick - make it then bootable. This" - echo "script prepare usb disks for 32-bit EFI systems." - echo "Superuser (root) privileges are required."; - echo; - echo "Usage: immudex-create-media [-e32 immudex.iso /dev/sdX] [-h] [-l file.iso /dev/sdX] [-n /dev/sdX] [-v]"; - echo; - echo "Options:"; - echo " -e32 immudex.iso /dev/sdX Creating 32-bit EFI bootable usb drive with iso image. (Compatibile with immudex images only.)"; - echo " --help Print this message."; - echo " -l file.iso /dev/sdX Load file.iso to /dev/sdX drive."; - echo " -n /dev/sdX Write 0's to 1st megabyte of disk, wiping partition table."; - echo " -v Print information about version, author and copyrights."; - echo; - echo "Exmaples:"; - echo " immudex-create-media Print this message."; - echo " immudex-create-media -l /dev/sdX file.iso Writes iso file to usb stick, made it bootable."; - echo " immudex-create-media -e32 /dev/sdX immudex.iso Create 32-bit EFI bootable usb stick with immudex."; - echo " immudex-create-media -n /dev/sdX Writes first MB with 0's, deleting partition table"; - echo; - echo "Report bugs to "; -} - -function version() { - echo "immudex-create-media 1.1"; - echo; - echo "Copyright (C) 2026 morketsmerke.org"; - echo "This is free software; see the source for copying conditions. There is NO"; - echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."; - echo; - echo "Written by xf0r3m."; -} - -if [ $UID -ne 0 ]; then - echo "Permission denied!"; - help; - exit 1; -fi - -if [ "$1" ] && [ "$1" = "-h" ]; then help; exit 0; fi -if [ "$1" ] && [ "$1" = "-v" ]; then version; exit 0; fi - -if [ "$1" ] && [ "$1" = "-e32" ]; then target="i386-efi"; shift; fi -if [ "$1" ] && [ "$1" = "-n" ]; then target="nuke"; shift; fi -if [ "$1" ] && [ "$1" = "-l" ]; then target="load"; shift; fi -if [ "$1" ] && $(echo $1 | grep -q '\.iso'); then - iso=$1; shift; -fi -if [ "$1" ] && $(echo $1 | grep -q '/dev/'); then - disk=$1; shift; -else - help; - exit 1; -fi - -if [ "$target" = "i386-efi" ]; then - echo -n "Writing zeros to 1st megabyte on disk..."; - dd if=/dev/zero bs=1M of=$disk count=1 > /dev/null 2>&1; - if [ $? -eq 0 ]; then echo -e "[${GREEN}OK${ENDCOLOR}]"; fi - - echo -n "Creating MS-DOS partitionig scheme on disk..."; - parted $disk mklabel msdos > /dev/null 2>&1; - if [ $? -eq 0 ]; then echo -e "[${GREEN}OK${ENDCOLOR}]"; fi - - echo -n "Creating FAT-32 partition..."; - parted $disk mkpart primary fat32 1 100%Free > /dev/null 2>&1; - if [ $? -eq 0 ]; then echo -e "[${GREEN}OK${ENDCOLOR}]"; fi - - echo -n "Creating VFAT filesystem on partition..."; - mkfs.vfat ${disk}1 > /dev/null 2>&1; - if [ $? -eq 0 ]; then echo -e "[${GREEN}OK${ENDCOLOR}]"; fi - - echo -n "Creating /mnt/usb directory..."; - mkdir /mnt/usb > /dev/null 2>&1; - if [ $? -eq 0 ]; then echo -e "[${GREEN}OK${ENDCOLOR}]"; - else echo -e "[${YELLOW}Directory exist!${ENDCOLOR}]"; fi - - echo -n "Mounting VFAT partition on /mnt/usb..."; - mount ${disk}1 /mnt/usb > /dev/null 2>&1; - if [ $? -eq 0 ]; then echo -e "[${GREEN}OK${ENDCOLOR}]"; fi - - echo -n "Instalation GRUB on disk..."; - grub-install --target=i386-efi --efi-directory=/mnt/usb --boot-directory=/mnt/usb/boot --bootloader-id=boot --removable > /dev/null 2>&1; - if [ $? -eq 0 ]; then echo -e "[${GREEN}OK${ENDCOLOR}]"; fi - - echo -n "Creating /mnt/iso directory..."; - mkdir /mnt/iso > /dev/null 2>&1; - if [ $? -eq 0 ]; then echo -e "[${GREEN}OK${ENDCOLOR}]"; - else echo -e "[${YELLOW}Directory exist!${ENDCOLOR}]"; fi - - echo -n "Mounting iso file on /mnt/iso..."; - mount $iso /mnt/iso > /dev/null 2>&1; - if [ $? -eq 0 ]; then echo -e "[${GREEN}OK${ENDCOLOR}]"; fi - - echo -n "Copying grub config files to the disk..."; - cp /mnt/iso/boot/grub/font.pf2 /mnt/usb/boot/grub > /dev/null 2>&1; - cp /mnt/iso/boot/grub/grub.cfg /mnt/usb/boot/grub > /dev/null 2>&1; - if [ $? -eq 0 ]; then echo -e "[${GREEN}OK${ENDCOLOR}]"; fi - - echo -n "Copying immudex files to the disk..."; - cp -r /mnt/iso/live /mnt/usb > /dev/null 2>&1; - if [ $? -eq 0 ]; then echo -e "[${GREEN}OK${ENDCOLOR}]"; fi - - echo -n "Creating empty DEBIAN file..."; - touch /mnt/usb/DEBIAN > /dev/null 2>&1; - if [ $? -eq 0 ]; then echo -e "[${GREEN}OK${ENDCOLOR}]"; fi - - echo -n "Umounting all mounted filesystems..."; - umount /mnt/usb /mnt/iso > /dev/null 2>&1; - if [ $? -eq 0 ]; then echo -e "[${GREEN}OK${ENDCOLOR}]"; fi - -elif [ "$target" = "nuke" ]; then - echo -n "Writing zeros to 1st megabyte on disk..."; - dd if=/dev/zero bs=1M of=$disk count=1 > /dev/null 2>&1; - if [ $? -eq 0 ]; then echo -e "[${GREEN}OK${ENDCOLOR}]"; fi - -elif [ "$target" = "load" ]; then - echo -n "Writing zeros to 1st megabyte on disk..."; - dd if=/dev/zero bs=1M of=$disk count=1 > /dev/null 2>&1; - if [ $? -eq 0 ]; then echo -e "[${GREEN}OK${ENDCOLOR}]"; fi - - echo -n "Writing iso image to the disk..." - dd if=$iso bs=1M of=$disk > /dev/null 2>&1; - if [ $? -eq 0 ]; then echo -e "[${GREEN}OK${ENDCOLOR}]"; fi -else - help; - exit 1; -fi diff --git a/immudex-complete-project/immudex-create-media.1.gz b/immudex-complete-project/immudex-create-media.1.gz deleted file mode 100644 index 6e379bb..0000000 Binary files a/immudex-complete-project/immudex-create-media.1.gz and /dev/null differ diff --git a/immudex-complete-project/immudex-crypt b/immudex-complete-project/immudex-crypt deleted file mode 100755 index fdc6875..0000000 --- a/immudex-complete-project/immudex-crypt +++ /dev/null @@ -1,202 +0,0 @@ -#!/bin/bash - -function help() { - - echo "immudex-crypt is script used for listing, open, close and create crypt_LUKS partitions."; - echo "Script creates 'immudex-crypt' mount points, every mount point end up with 'index'."; - echo "Index is order number of opening crypt_LUKS devices via 'immudex-crypt' The first"; - echo "opened device will have index equal 0, second = 1, and so on and on."; - echo "Superuser (root) privileges are required."; - echo; - echo "Usage: immudex-crypt [-c index] [-f /dev/partition] [-h] [-l] [-o /dev/crypt_LUKS_device] [-v]"; - echo; - echo "Options:"; - echo " -c INDEX/icINDEX/immudex-cryptINDEX Unmounting and close opened crypt_LUKS devices."; - echo " -f /dev/partition Preparing device for crypt_LUKS."; - echo " -h Prints this message."; - echo " -l Prints list of opened and available crypt_LUKS devices."; - echo " -o /dev/crypt_LUKS_device Opening and mount crypt_LUKS device (it creates mount point, if not exist)."; - echo " -v Print information about version, author and copyrights."; - echo; - echo "Examples:"; - echo " immudex-crypt -l List available crypt_LUKS devices in the system."; - echo " immudex-crypt -f /dev/sdX Create crypt_LUKS device from given partition."; - echo " immudex-crypt -o /dev/sdX Open given crypt_LUKS device (with mounting file system, of course)."; - echo " immudex-crypt -c 0 Close first opened crypt_LUKS device in the system."; - echo; - echo "Report bugs to "; -} - -function version() { - echo "immudex-crypt 1.1"; - echo; - echo "Copyright (C) 2026 morketsmerke.org"; - echo "This is free software; see the source for copying conditions. There is NO"; - echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."; - echo; - echo "Written by xf0r3m."; -} - -function list() { - - mapperDeviceList=$(ls /dev/mapper | grep 'immudex-*' | awk '{printf $1" "}'); - - echo "=============================================================="; - echo -e "Opened devices:"; - echo "=============================================================="; - echo -e "Device:\t\tMapper name:\t\tMount point:"; - - if [ "$mapperDeviceList" ]; then - for dmDevice in $mapperDeviceList; do - if cryptsetup status /dev/mapper/${dmDevice} > /dev/null 2>&1; then - mountPoint=$(df --output=source,target /dev/mapper/${dmDevice} | tail -n 1 | awk '{printf $2}'); - device=$(cryptsetup status /dev/mapper/${dmDevice} | grep "device" | awk '{printf $2}'); - if [ "$mountPoint" ] && [ "$mountPoint" != "/dev" ]; then - echo -e "$device\t /dev/mapper/${dmDevice}\t$mountPoint"; - else - echo -e "$device\t /dev/mapper/${dmDevice}\tNot mounted"; - fi - fi - done - else - echo -e "No opened crypt devices was found"; - fi - echo "=============================================================="; - - luksDevicesList=$(blkid | grep 'LUKS' | cut -d ":" -f 1 | awk '{printf $1" "}'); - - echo "=============================================================="; - echo -e "crypt_LUKS devices:"; - echo "=============================================================="; - echo -e "Device:\t\t\tSize:"; - - if [ "$luksDevicesList" ]; then - for lDevice in $luksDevicesList; do - lDeviceSize=$(lsblk | grep "$(basename $lDevice)" | sed -n '1p' | awk '{printf $4}'); - echo -e "$lDevice\t\t$lDeviceSize"; - done - else - echo "No crypt device was found"; - fi - echo "=============================================================="; -} - -function open() { - - if [ $# -lt 1 ]; then help; exit 1; - else - index=$(ls --hide=control /dev/mapper | grep "immudex-crypt" | grep -o "[0-9]*$"| tail -1); - if [ "$index" ]; then - index=$((index + 1)); - else - index=0; - fi - cryptsetup open $1 immudex-crypt${index}; - mkdir -p /media/${USER}/immudex-crypt${index}; - lastField=$(ls -l /dev/mapper/immudex-crypt${index} | grep -o ' ' | wc -l); - dmDevice=$(ls -al /dev/mapper/immudex-crypt${index} | cut -d " " -f ${lastField}- | cut -d "/" -f2); - if ! $(file -s /dev/${dmDevice} | grep -q 'ext4'); then - echo "Could not determine filesystem of unlocked device."; - echo -n "Format this device to ext4? (y/n): " - read format; - if [ "$format" = "y" ]; then - mkfs.ext4 /dev/mapper/immudex-crypt${index}; - else - echo "Refuse to mount."; - cryptsetup close immudex-crypt${index}; - exit 1; - fi - fi - mount /dev/mapper/immudex-crypt${index} /media/${USER}/immudex-crypt${index}; - if [ ! -e /ic${index} ]; then - ln -s /media/${USER}/immudex-crypt${index} /ic${index}; - fi - fi - -} - -function close() { - - if [ $# -lt 1 ]; then help; exit 1; - else - if [ $1 -ge 0 ] 2> /dev/null; then - cryptfsName="immudex-crypt${1}"; - elif echo $1 | grep -q 'ic'; then - cryptfsName="immudex-crypt$(echo $1 | grep -o '[0-9]')"; - else - cryptfsName=$1; - fi - if cryptsetup status /dev/mapper/${cryptfsName} > /dev/null 2>&1; then - mountPoint=$(df --output=source,target /dev/mapper/${cryptfsName} | tail -1 | awk '{printf $2}'); - if [ "$mountPoint" ] && [ "$mountPoint" != "/dev" ]; then - umount -R $mountPoint; - cryptsetup close ${cryptfsName}; - else - cryptsetup close ${cryptfsName}; - fi - else - echo "Given devices isn't opened crypt device or it was closed before"; - fi - fi -} - -function create() { - if [ $# -lt 1 ]; then help; exit 1; - else - cryptsetup -y -v luksFormat $1; - fi -} - -function set_ownership(){ - if [ $# -lt 1 ]; then help; exit 1; - else - mountPoint=$(list | grep "$USER" | grep "$1" | awk '{printf $3}') - owner=$(stat -c %u $mountPoint); - if [ $owner -eq $RUID ]; then - if id $USER | grep -q $RUID; then - echo "User $USER is already owner of $mountPoint"; - fi - else - chown ${USER}:${USER} $mountPoint; - fi - fi -} - -if [ "$1" ]; then - - if [ $UID -ne 0 ]; then - echo "Permission denied!"; - help; - exit 1; - fi - - #immudex-crypt RUID is EUID of sudo, which spawning immudex-crypt - if $(pidof -sq sudo); then - export RUID=$(grep '^Uid:' /proc/$(pidof -s sudo)/status | awk '{printf $2}'); - export USER=$(grep "$RUID" /etc/passwd | cut -d ":" -f1); - fi - - option=$1; - value=$2; - - case $option in - "-l") list;; - "-o") if [ "$value" ]; then open $value; - else help; exit 1; - fi;; - "-c") if [ "$value" ]; then close $value; - else help; exit 1; - fi;; - "-f") if [ "$value" ]; then - create $value; - open $value; - set_ownership $value; - else help; exit 1; - fi;; - "-h") help; exit 0;; - "-v") version; exit 0;; - *) help;; - esac -else - help; exit 1; -fi diff --git a/immudex-complete-project/immudex-crypt.1.gz b/immudex-complete-project/immudex-crypt.1.gz deleted file mode 100644 index 1340bbb..0000000 Binary files a/immudex-complete-project/immudex-crypt.1.gz and /dev/null differ diff --git a/immudex-complete-project/immudex-hostname b/immudex-complete-project/immudex-hostname deleted file mode 100755 index 5f0af48..0000000 --- a/immudex-complete-project/immudex-hostname +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/bash - -function help() { - echo "immudex-hostname it's a main executional script for immudex-hostname"; - echo "service. The script job is to change set appropriate name for this"; - echo "host based on computer chassis and 7 last chars from boot ID." - echo; - echo "Usage: immudex-hostname [-h] [-v]"; - echo; - echo "Options:"; - echo " -h Print this message."; - echo " -v Print information about version, author and copyrights." - echo; - echo "Examples:"; - echo " immudex-hostname Set apropriate hostname, usually executed by systemd."; - echo " immudex-hostname -h Print this message."; - echo " immudex-hostname -v Print information about version, author and copyrights."; - echo; - echo "Files:"; - echo " /usr/lib/systemd/system/immudex-hostname.service Systemd unit file, to run immudex-hostname script as a service."; - echo; - echo "Report bugs to "; -} - -function version() { - echo "immudex-hostname 1.1"; - echo; - echo "Copyright (C) 2026 morketsmerke.org"; - echo "This is free software; see the source for copying conditions. There is NO"; - echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."; - echo; - echo "Written by xf0r3m."; - -} - -if [ "$1" ]; then - if [ "$1" = "-h" ]; then - help; - elif [ "$1" = "-v" ]; then - version; - fi -else - if [ $UID -ne 0 ]; then - echo "Permission denied!"; - exit 1; - fi - - bootID=$(sed 's/-//g' /proc/sys/kernel/random/boot_id | cut -c 26-33); - if hostnamectl > /dev/null 2>&1; then - hName="$(hostnamectl | grep 'Chassis' | cut -d ":" -f 2 | awk '{printf $1}')-${bootID}"; - else - hName="$(dmidecode -s chassis-type | head -1 | tr [A-Z] [a-z])-${bootID}"; - fi - - hostnamectl set-hostname $hName; - sed -i "s/immudex/${hName}/g" /etc/hosts; - echo $hName | sudo tee /etc/hostname > /dev/null; -fi diff --git a/immudex-complete-project/immudex-hostname.1.gz b/immudex-complete-project/immudex-hostname.1.gz deleted file mode 100644 index 7553472..0000000 Binary files a/immudex-complete-project/immudex-hostname.1.gz and /dev/null differ diff --git a/immudex-complete-project/immudex-import-gpgkeys b/immudex-complete-project/immudex-import-gpgkeys deleted file mode 100755 index e653a6b..0000000 --- a/immudex-complete-project/immudex-import-gpgkeys +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash - -function help() { - echo "it's a script for import GPG keys and owner trust. GPG keys can be used"; - echo "by 'pass' - POSIX compatibile password manager or signing. It's very"; - echo "helpful, when your keys are in files in encrypted datastore."; - echo "Script requires to store GPG keys in home dir or change home dir before"; - echo "execute a script."; - echo; - echo "Usage: immudex-import-gpgkeys [-h] [-v]"; - echo; - echo "Options:"; - echo " -h Print this message."; - echo " -v Print information about version, author and copyrights"; - echo; - echo "Examples:"; - echo " immudex-import-gpgkeys Import GPG keys and owner trust."; - echo " immudex-import-gpgkeys -h Print this message."; - echo " immudex-import-gpgkeys -v Print information about version, author and copyrights."; - echo; - echo "Report bugs to "; -} - -function version() { - echo "immudex-import-gpgkeys 1.1"; - echo; - echo "Copyright (C) 2026 morketsmerke.org"; - echo "This is free software; see the source for copying conditions. There is NO"; - echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."; - echo; - echo "Written by xf0r3m."; -} - -if [ "$1" ]; then - if [ "$1" = "-h" ]; then - help; - elif [ "$1" = "-v" ]; then - version; - fi -else - if [ -f ~/public.gpg ] && [ -f ~/private.gpg ] && [ -f ~/otrust.txt ]; then - gpg --import ~/public.gpg - gpg --import ~/private.gpg - gpg --import-ownertrust ~/otrust.txt - fi -fi diff --git a/immudex-complete-project/immudex-import-gpgkeys.1.gz b/immudex-complete-project/immudex-import-gpgkeys.1.gz deleted file mode 100644 index 5539a11..0000000 Binary files a/immudex-complete-project/immudex-import-gpgkeys.1.gz and /dev/null differ diff --git a/immudex-complete-project/immudex-import-sshkeys b/immudex-complete-project/immudex-import-sshkeys deleted file mode 100755 index 6f7a72d..0000000 --- a/immudex-complete-project/immudex-import-sshkeys +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/bash - -function help() { - echo "it's a script for copying OpenSSH client files such as keys and config file into user native home directory."; - echo "This command should be run in other home directory, where ssh keys are stored."; - echo; - echo "Usage: immudex-import-sshkeys [-i] [-h] [-v]"; - echo; - echo "Options:"; - echo " -i Import hostnames and adresses to /etc/host file (sudo required) from SSH config file if exist."; - echo " -h Print this message."; - echo " -v Print information about version, author and copyrights."; - echo; - echo "Examples:"; - echo " immudex-import-sshkeys Import OpenSSH client files into user native home dir."; - echo " immudex-import-sshkeys -i Import OpenSSH client files and create DNS resolve database in /etc/hosts by taking data from OpenSSH client config file, if exist."; - echo " immudex-import-sshkeys -h Print this message."; - echo " immudex-import-sshkeys -v Print information about version, author and copyrights." - echo; - echo "Report bugs to "; -} - -function version() { - echo "immudex-import-sshkeys 1.1"; - echo; - echo "Copyright (C) 2026 morketsmerke.org"; - echo "This is free software; see the source for copying conditions. There is NO"; - echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."; - echo; - echo "Written by xf0r3m."; -} - -if [ "$1" ]; then - if [ "$1" = "-h" ]; then - help; - elif [ "$1" = "-v" ]; then - version; - fi -else -if $(ls $HOME | grep -q '.*_rsa.*'); then - if [ -d /home/$USER/.ssh ]; then - cp -v ~/*_rsa* /home/$USER/.ssh; - else - mkdir /home/$USER/.ssh; - chmod 700 /home/$USER/.ssh; - cp -v ~/*_rsa* /home/$USER/.ssh; - fi -fi -if $(ls -w1 $HOME | grep -q '^config$'); then - cp -v ~/config /home/$USER/.ssh; - if [ "$1" ] && [ "$1" = "--import-hosts" ]; then - i=1; - hostsCount=$(grep -o "Host .*" ~/config | wc -l); - while [ $i -le $hostsCount ]; do - host=$(grep -o "Host .*" ~/config | sed -n "${i}p" | awk '{printf $2}'); - hostName=$(grep -o "HostName .*" ~/config | sed -n "${i}p" | awk '{printf $2}'); - echo -e "${host}\t${hostName}" | sudo tee -a /etc/hosts; - i=$(expr $i + 1); - done - fi - chmod 600 /home/$USER/.ssh/config; -fi -fi diff --git a/immudex-complete-project/immudex-import-sshkeys.1.gz b/immudex-complete-project/immudex-import-sshkeys.1.gz deleted file mode 100644 index 4d0ba56..0000000 Binary files a/immudex-complete-project/immudex-import-sshkeys.1.gz and /dev/null differ diff --git a/immudex-complete-project/immudex-install b/immudex-complete-project/immudex-install deleted file mode 100755 index 18139c1..0000000 --- a/immudex-complete-project/immudex-install +++ /dev/null @@ -1,214 +0,0 @@ -#!/bin/bash - -RED="\e[31m"; -GREEN="\e[32m"; -ENDCOLOR="\e[0m"; - -function help() { - echo "it's a script for installation immudex LiveCD images on computer hard"; - echo "disk. This program runs interactivly and the one thing you need to do"; - echo "is choose a right disk for installation. That's all, but if you using"; - echo "custom images, you may need change partition size for immudex image." - echo "It's hard to imagine, how it's possible to create images bigger than 3"; - echo "GB. It would happens. More space in this partition is also needed for"; - echo "upgrades tasks. So if your image is bigger than 2 GiB, you need to "; - echo "change size of this partition before you start instalation."; - echo "Recomended size is 3 times the image size. The partition size can be"; - echo "changed via below described option."; - echo "This script requires superuser (root) privileges."; - echo; - echo "Usage: immudex-install [-h] [-p 3G] [-v]"; - echo; - echo "Options:"; - echo " -h Print this message."; - echo " -p 3G This option change a partition size with immudex image. Usefull for custom builds. By default it's 3GB."; - echo " -v Print information about version, author and copyrights."; - echo; - echo "Examples:"; - echo " immudex-install Standard execution, instalation immudex LiveCD on computer hard disk."; - echo " immudex-install -p 6G Run install script for custom immudex image build."; - echo " immudex-install -h Print this message."; - echo " immudex-install -v Print information about version, author and copyrights."; - echo; - echo "Report bugs to "; -} - -function version() { - echo "immudex-install 1.1"; - echo; - echo "Copyright (C) 2026 morketsmerke.org"; - echo "This is free software; see the source for copying conditions. There is NO"; - echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."; - echo; - echo "Written by xf0r3m."; - -} - -if [ "$1" ]; then - if [ "$1" = "-h" ]; then - help; - exit 0; - elif [ "$1" = "-v" ]; then - version; - exit 0; - fi -fi -if [ "$1" ]; then - if $(echo $1 | grep -q '-p'); then - if [ "$2" ]; then - idxPartSize=$2; - else - idxPartSize="3G"; - fi - else - idxPartSize="3G"; - fi -else - idxPartSize="3G"; -fi - -#if [ $UID -ne 0 ]; then -# echo "Permission denied!"; -# exit 1; -#fi - -while [ true ]; do - echo -e "${RED}This script will install immudex on first disk on your machine.${ENDCOLOR}"; - echo -e "${RED}It could be destructive for data placed on this disk${ENDCOLR}"; - echo -en "${RED}Are you sure that you want contiune? (y/n): ${ENDCOLOR}"; - read ans; - if [ "$ans" = "y" ]; then break; - elif [ "$ans" = "n" ]; then exit 1; - fi -done - -set -e - -function selectDisk() { - disks=$(lsblk | grep 'disk' | awk '{printf $1" "}'); - if [ $(echo $disks | wc -w) -gt 1 ]; then - select drive in $disks; do - echo $drive; - break; - done - else - echo $disks | awk '{printf $1}'; - fi -} - -if $(sudo efibootmgr > /dev/null 2>&1); then -#uefi installation - #partitioning - echo -n "Installation immudex in EFI mode ... "; - disk=$(selectDisk); - originDisk=$disk; - if [ ! "$disk" ]; then exit 1; fi - - dd if=/dev/zero bs=1M of=/dev/$disk count=1 2> /dev/null - - parted /dev/$disk mklabel msdos > /dev/null 2>&1; - parted /dev/$disk mkpart primary 1 101M > /dev/null 2>&1; - parted /dev/$disk set 1 boot on > /dev/null 2>&1; - parted /dev/$disk mkpart primary 101M $idxPartSize > /dev/null 2>&1; - - if $(echo $disk | egrep -qo "mmc|nvme"); then disk="${disk}p"; fi - - #formatting - mkfs.vfat -F32 /dev/${disk}1 > /dev/null 2>&1; - mkfs.ext4 /dev/${disk}2 > /dev/null 2>&1; - - #Setting label for partition - e2label /dev/${disk}2 "immudex" > /dev/null 2>&1; - - #mount root partition - mount /dev/${disk}2 /media > /dev/null 2>&1; - - #creating directories for efi partition - mkdir -p /media/boot/efi > /dev/null 2>&1; - - #mount efi partition - mount /dev/${disk}1 /media/boot/efi > /dev/null 2>&1; - - #mount iso image in /mnt directory - #sudo mount /dev/sr0 /mnt > /dev/null 2>&1; - - #copying whole iso image to the second partition - cp -rvv /run/live/medium/* /media > /dev/null 2>&1; - - sed -i '/set\ timeout=/ s/30/5/' /media/boot/grub/grub.cfg; - sed -i 's/bootfrom=removable //g' /media/boot/grub/grub.cfg; - - #removing unnecessary directories from second partition - rm -rf /media/isolinux > /dev/null 2>&1; - rm -rf /media/EFI > /dev/null 2>&1; - - #GRUB Installation - if [ -f /usr/lib/live/mount/medium/EFI/BOOT/BOOTIA32.EFI ]; then - target="i386-efi"; - else - target="x86_64-efi"; - fi - grub-install --target=${target} --root-directory=/media --boot-directory=/media/boot --efi-directory=/media/boot/efi --bootloader-id=debian --removable > /dev/null 2>&1; - - #Adding entry to EFI Firmware - efibootmgr -c -d /dev/${originDisk} -p 1 -L "Debian" -l '\EFI\BOOT\grubx64.efi' > /dev/null 2>&1; - - #Umount all mounted filesystems - umount -R /media > /dev/null 2>&1; - - if [ $? -eq 0 ]; then echo -e "[ ${GREEN}OK${ENDCOLOR} ]"; fi - -else -#mbr installation - echo -n "Installation immudex in BIOS mode ... "; - - #partitioning - disk=$(selectDisk); - if [ ! "$disk" ]; then exit 1; fi - - dd if=/dev/zero bs=1M of=/dev/$disk count=1 2> /dev/null - - parted /dev/$disk mklabel msdos > /dev/null 2>&1; - parted /dev/$disk mkpart primary 1 $idxPartSize > /dev/null 2>&1; - parted /dev/$disk set 1 boot on > /dev/null 2>&1; - - if $(echo $disk | egrep -qo "mmc|nvme"); then disk="${disk}p"; fi - - #formatting - mkfs.ext4 /dev/${disk}1 > /dev/null 2>&1; - - #Setting label for partition is necessary for extlinux bootloader - e2label /dev/${disk}1 "immudex" > /dev/null 2>&1; - - #mount partition in /media directory - mount /dev/${disk}1 /media > /dev/null 2>&1; - - #Creating directory for extlinux - mkdir /media/extlinux > /dev/null 2>&1; - - #Instalation extlinux files in abovementioned directory - extlinux --install /media/extlinux > /dev/null 2>&1; - - #mount iso image in /mnt directory - #sudo mount /dev/sr0 /mnt > /dev/null 2>&1; - - #copying live directory from iso image to partition - cp -rvv /run/live/medium/live /media > /dev/null; 2>&1; - - #installation extlinux MBR on first sector of hard drive (whole device) - dd if=/usr/lib/EXTLINUX/mbr.bin of=/dev/${disk} > /dev/null 2>&1; - - #creating extlinux configuration file - cat > extlinux.conf < /dev/null 2>&1; - rm extlinux.conf; - - #Unmounting filesystems - umount /media > /dev/null 2>&1; - if [ $? -eq 0 ]; then echo -e "[ ${GREEN}OK${ENDCOLOR} ]"; fi -fi diff --git a/immudex-complete-project/immudex-install.1.gz b/immudex-complete-project/immudex-install.1.gz deleted file mode 100644 index f1b4628..0000000 Binary files a/immudex-complete-project/immudex-install.1.gz and /dev/null differ diff --git a/immudex-complete-project/immudex-meteo b/immudex-complete-project/immudex-meteo deleted file mode 100755 index c040f6d..0000000 --- a/immudex-complete-project/immudex-meteo +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash - -function help() { - echo "immudex-meteo script fetching weather status from wttr.in webpage." - echo "The weather status is availabel to get in 3 formats described below"; - echo "in options."; - echo; - echo "Usage: immudex-meteo [-h] [-l|-m|-s location] [-v]"; - echo; - echo "Options:"; - echo " -h Prints this message"; - echo " -l location Long format, more readable, weather for every stage of the day and 2-day forecast"; - echo " -m location Micro format, one line with details (current weather)"; - echo " -s location Short human readable format with one small ascii art."; - echo " -v Prints information about version, author and copyrights"; - echo; - echo "Exmaples:"; - echo " immudex-meteo -s London Current weather in London in short format."; - echo " immudex-meteo -l Berlin Weather for whole day in Berlin and 2-day forecast."; - echo " immudex-meteo -m Warszawa One line with weather information from Warsaw, good for motd's or resources monitors."; - echo; - echo "Report bugs to "; -} - -function version() { - echo "immudex-meteo 1.1"; - echo; - echo "Copyright (C) 2026 morketsmerke.org"; - echo "This is free software; see the source for copying conditions. There is NO"; - echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."; - echo; - echo "Written by xf0r3m."; -} - -if [ "$1" ]; then - case $1 in - "-s") curl wttr.in/${2}?0\&lang=pl;; - "-l") curl wttr.in/${2}?lang=pl;; - "-m") curl wttr.in/${2}?format=4;; - "-h") help; exit 0;; - "-v") version; exit 0;; - *) help; exit 1;; - esac -else - help; - exit 1; -fi diff --git a/immudex-complete-project/immudex-meteo.1.gz b/immudex-complete-project/immudex-meteo.1.gz deleted file mode 100644 index f7657a2..0000000 Binary files a/immudex-complete-project/immudex-meteo.1.gz and /dev/null differ diff --git a/immudex-complete-project/immudex-motd b/immudex-complete-project/immudex-motd deleted file mode 100755 index 0d3fa8c..0000000 --- a/immudex-complete-project/immudex-motd +++ /dev/null @@ -1,107 +0,0 @@ -#!/bin/bash - - -if [ "$1" ]; then - if [ "$1" = "-h" ]; then - echo "immudex-motd prints configurable message of the day."; - echo "Information and its quantity can be changed via the configuration file."; - echo "Script using figlet basic font and lolcat for print header of message."; - echo; - echo "Usage: immudex-motd [-h] [-v]"; - echo; - echo "Options:"; - echo " -h Print this message."; - echo " -v Print information about version, author and copyright"; - echo; - echo "Files:"; - echo " /etc/motd.conf Script configuration file."; - echo " /usr/share/doc/immudex-motd/motd.conf.sample Example configuration file."; - echo; - echo "Examples:"; - echo " immudex-motd Run a script."; - echo; - echo "Report bugs to "; - exit 0; - fi - if [ "$1" = "-v" ]; then - echo "immudex-motd 1.1"; - echo; - echo "Copyright (C) 2026 morketsmerke.org"; - echo "This is free software; see the source for copying conditions. There is NO"; - echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."; - echo; - echo "Written by xf0r3m."; - exit 0; - fi -fi - -if [ -f /etc/motd.conf ]; then - source /etc/motd.conf; -else - source /usr/share/doc/immudex-motd/motd.conf.sample; -fi - -echo -en "\e[1m"; echo "$(hostname)" | /usr/bin/figlet | lolcat; echo -en "\e[0m"; -echo; -echo "Today is: $(date)"; -echo; -echo "System summary: "; -cpuIdle=$(vmstat | tail -1 | awk '{printf $15}'); -cpuUsage=$((100 - $cpuIdle)); -echo -e " \tCPU: ${cpuUsage}%"; -echo -e " \tMEM: $(free -h | sed -n '2p' | awk '{printf $7}' | sed 's/i//') Free"; -if [ "$MOUNT_POINTS" ]; then - echo -e " \tMount points:\tFree/Total\t(Usage%)"; - for mountPoint in $MOUNT_POINTS; do - if $(df -h 2>/dev/null | grep -q "${mountPoint}"); then - diskSize=$(df -h 2> /dev/null | grep "${mountPoint}" | awk '{printf $2}'); - diskFree=$(df -h 2> /dev/null | grep "${mountPoint}" | awk '{printf $4}'); - diskUsage_perc=$(df -h 2> /dev/null | grep "${mountPoint}" | sed 's/%//' | awk '{printf $5}'); - echo -e "\t$(echo $mountPoint | sed 's,\$,,'):\t\t${diskFree}/${diskSize}\t(${diskUsage_perc}%)"; - fi - done -fi -if $(echo $OPTIONS | grep -q 'cryptparts'); then - if $(df -h 2> /dev/null | grep -q '/dev/mapper'); then - i=1; - echo -e " \tCRYPT_PARTi: Free/Total (Usage%)"; - amountOfDisks=$(df -h 2> /dev/null | grep '/dev/mapper' | wc -l | awk '{printf $1}'); - while [ $i -le $amountOfDisks ]; do - diskSize=$(df -h 2> /dev/null | grep '/dev/mapper' | sed -n "${i}p" | awk '{printf $2}'); - diskFree=$(df -h 2> /dev/null | grep '/dev/mapper' | sed -n "${i}p" | awk '{printf $4}'); - diskUsage_perc=$(df -h 2> /dev/null | grep '/dev/mapper' | sed -n "${i}p" | sed 's/%//' | awk '{printf $5}'); - #FCP = First Crypt Partition - echo -e " \tCRYPT_PART${i}: ${diskFree}/${diskSize} (${diskUsage_perc}%)"; - i=$((i + 1)); - done - else - echo -e " \tCRYPT_PART: N/A"; - fi -fi -echo -e " \tIP: $(ip addr show $(sed -n '2p' /proc/net/route | awk '{printf $1}') | grep 'inet\ ' | awk '{printf $2"\n"}')"; -echo -e " \tPROCESSES: $(ps -aux | wc -l | awk '{printf $1}')"; -if $(uptime | grep -q 'day'); then - utime=$(uptime | awk '{printf $3" "$4" "$5}' | sed -e 's/\,$//' -e 's,:,h ,'); - echo -e "\tUPTIME: ${utime}m"; -else - utime=$(uptime | awk '{printf $3}' | sed -e 's/,//' -e 's,:,h ,'); - if $(echo $utime | grep -q "h"); then - echo -e " \tUPTIME: ${utime}m"; - else - echo -e " \tUPTIME: 0h ${utime}m"; - fi -fi -echo -e " \t$(uptime | grep -o "load.*$" | tr [a-z] [A-Z])"; -echo; -if [ -x /usr/local/bin/immudex-meteo ]; then -echo "Weather:"; - if [ "$LOCATION" ]; then - /usr/local/bin/immudex-meteo --micro $LOCATION; - fi -fi -echo; -if [ "$FOOTER" ]; then - echo -e "$FOOTER"; -fi -echo; -echo "===================================================================="; diff --git a/immudex-complete-project/immudex-motd.1.gz b/immudex-complete-project/immudex-motd.1.gz deleted file mode 100644 index 3933c5a..0000000 Binary files a/immudex-complete-project/immudex-motd.1.gz and /dev/null differ diff --git a/immudex-complete-project/immudex-padlock b/immudex-complete-project/immudex-padlock deleted file mode 100755 index 36254e5..0000000 --- a/immudex-complete-project/immudex-padlock +++ /dev/null @@ -1,120 +0,0 @@ -#!/bin/bash - -function help(){ - echo "it's a switch script. This script, if there is more than one cryptdisk"; - echo "gives a change to choose a cryptdisk and starts opening him. After"; - echo "sucessful opening, it spawns a terminal window with CWD sets up on"; - echo "choosed cryptdisk mountpoint and change the launcher icon in the bottom"; - echo "panel, which informs user, there are a opened cryptdisks. When user,"; - echo "execute script once again, he close all opened cryptdisk either that"; - echo "not open with this script. At least he tries. In some cases it will be"; - echo "impossible, because there are processes which using this cryptdisk or"; - echo "inside this mount point there is other mount point. This is signaled,"; - echo "by apropriate notification."; - echo "This script needs superuser (root) privileges, but using sudo command"; - echo "is implemented inside the script, you don't needed to launch this"; - echo "via sudo."; - echo; - echo "Usage: immudex-padlock [-h] [-v]"; - echo; - echo "Example:"; - echo " immudex-padlock Standard script execution, explained above."; - echo " immudex-padlock -h Print this message."; - echo " immudex-padlock -v Print information about version, author and copyrights."; - echo; - echo "Files:"; - echo " /usr/share/icons/padlock-icon.png Symlink, original launcher icon."; - echo " /usr/share/icons/changes-prevent.png Original, closed padlock icon."; - echo " /usr/share/icons/changes-allow.png Original, open padlock icon."; - echo " /etc/skel/.config/xfce4/panel/launcher-14/16844255236.desktop XFCE4 bottom panel script activator."; - echo; - echo "Report bugs to "; -} - -function version(){ - echo "immudex-padlock 1.1"; - echo; - echo "Copyright (C) 2026 morketsmerke.org"; - echo "This is free software; see the source for copying conditions. There is NO"; - echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."; - echo; - echo "Written by xf0r3m."; -} - -launcher="/home/${USER}/.config/xfce4/panel/launcher-14/16844255236.desktop"; - -function main_unlock() { - sudo /usr/local/sbin/immudex-crypt -o $1; - index=$(basename $(sudo /usr/local/sbin/immudex-crypt -l | grep "$1" | head -1 | awk '{printf $2}' | grep -o '[0-9]')); - #sudo mkdir -p /media/${USER}/$devName; - #sudo mount /dev/mapper/$devName /media/${USER}/$devName; - - xfce4-terminal --default-working-directory=/ic${index}; - sed -i 's/padlock-icon/changes-allow/' ${launcher}; - #sudo rm /usr/share/icons/padlock-icon.png; - #sudo ln -s /usr/share/icons/changes-allow.png /usr/share/icons/padlock-icon.png; - -} - -function unlock() { - - cryptParts=$(sudo blkid | grep 'LUKS' | sed 's/://g' | awk '{printf $1" "}'); - if [ "$cryptParts" ]; then - if [ $(echo $cryptParts | wc -w) -gt 1 ]; then - select cryptPart in $cryptParts; do - main_unlock $cryptPart; - break; - done - else - main_unlock $cryptParts; - fi - else - echo -e "\e[31mThere is no LUKS partition to open.\e[0m"; - sleep 3; - fi -} - -function lock() { - - mapperDeviceList=$(ls /dev/mapper | grep 'immudex-*' | awk '{printf $1" "}'); - - if [ "$mapperDeviceList" ]; then - for dmDevice in $mapperDeviceList; do - if sudo cryptsetup status /dev/mapper/${dmDevice} > /dev/null 2>&1; then - mountPoint=$(df --output=source,target /dev/mapper/${dmDevice} | tail -n 1 | awk '{printf $2}'); - if [ "$mountPoint" ]; then - if $(sudo lsof $mountPoint > /dev/null 2>&1); then - notify-send "Padlock" "The /dev/mapper/${dmDevice} cannot be unmount, because there are opened file or running proceses." --icon=dialog-error; - else - sudo umount $mountPoint; - if [ $? -ne 0 ]; then - notify-send "Padlock" "The /dev/mapper/${dmDevice} cannot be unmount, because there are other filesystem is mounted in." --icon=dialog-error; - fi - sudo cryptsetup close /dev/mapper/${dmDevice}; - fi - else - sudo cryptsetup close /dev/mapper/${dmDevice}; - fi - fi - done - fi - if ! $(df -h | grep -q '/dev/mapper'); then - sed -i 's/changes-allow/padlock-icon/' ${launcher}; - #sudo rm /usr/share/icons/padlock-icon.png; - #sudo ln -s /usr/share/icons/changes-prevent.png /usr/share/icons/padlock-icon.png; - fi -} - -if [ "$1" ]; then - if [ "$1" = "-h" ]; then - help; - elif [ "$1" = "-v" ]; then - version; - fi -else - mapperDeviceList=$(ls /dev/mapper | grep 'immudex-*' | awk '{printf $1" "}'); - - if [ "$mapperDeviceList" ]; then lock; - else unlock; - fi -fi diff --git a/immudex-complete-project/immudex-padlock.1.gz b/immudex-complete-project/immudex-padlock.1.gz deleted file mode 100644 index 6edbf60..0000000 Binary files a/immudex-complete-project/immudex-padlock.1.gz and /dev/null differ diff --git a/immudex-complete-project/immudex-pl b/immudex-complete-project/immudex-pl deleted file mode 100755 index 077db0e..0000000 --- a/immudex-complete-project/immudex-pl +++ /dev/null @@ -1,146 +0,0 @@ -#!/bin/bash - -GREEN="\e[32m"; -RED="\e[31m"; -YELLOW="\e[33m"; -ENDCOLOR="\e[0m"; -SYSTEM_CC=$(echo $LANG | cut -c 1-2); - -function help() { - echo "immudex-pl opening (play) links. Script creates menu from link list, which"; - echo "can be open via mpv (with yt-dlp hook). Normally links are open as"; - echo "audio stream. Script work in loop, which means you can change playback"; - echo "while the current one is still playing. When you need to exit type any letter instead of number."; - echo "Script is not only for YouTube Links, it can also open"; - echo "internet radios or shoutcasts. The link list can be downloaded and does"; - echo "not need to be stored on the target device. Script will delete the"; - echo "file at the end of its execution. "; - echo; - echo "Usage: immudex-pl [-h] [-i] [-v youtube_video_quality] link-list"; - echo; - echo "Options:"; - echo " -v 240p...1080p Open link as video."; - echo " -h Print this message."; - echo " -i Print information about version, author and copyrights."; - echo; - echo "Files:"; - echo " /usr/share/doc/immudex-pl/links.list.example Example link list file."; - echo; - echo "Examples:" - echo " immudex-pl ~/radio-links.txt Open given link list as audio stream."; - echo " immudex-pl -v 360p ./yt-links Open given link list as video in 360p format."; - echo; - echo "Report bugs to "; -} - -function version() { - echo "immudex-pl 1.1"; - echo; - echo "Copyright (C) 2026 morketsmerke.org"; - echo "This is free software; see the source for copying conditions. There is NO"; - echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."; - echo; - echo "Written by xf0r3m."; -} - -if [ "$1" ] && [ $1 = "-v" ]; then - video=1; - shift; - if $(echo $1 | grep -q '[0-9]*p'); then - format=$(echo $1 | sed 's/p//g') - fi - shift; - file=$1; -elif [ "$1" ] && [ $1 = "-h" ]; then - help; - exit 0; -elif [ "$1" ] && [ $1 = "-i" ]; then - version; - exit 0; -else - file=$1; -fi - - -if echo $file | grep -q 'http'; then - echo -n "Getting link list..."; - wget -q $file -O /tmp/playlist.txt; - if [ $? -eq 0 ]; then - echo -e "[ ${GREEN}OK${ENDCOLOR} ]"; - file="/tmp/playlist.txt"; - else - echo -e "[ ${RED}FAIL${ENDCOLOR} ]"; - help; - exit 1; - fi -fi - -if [ "$file" ]; then - PS3="Link: "; - linkNames=$(cut -d ":" -f 1 $file | sed 's/\ /_/g' | awk '{printf $1" "}') - select name in $linkNames; do - if [ "$MPVPID" ]; then kill $MPVPID; fi - if [ ! "$name" ]; then break; fi - link=$(grep "$name" $file | cut -d ":" -f 2-3); - if [ ! "$link" ]; then - linkName=$(echo $name | sed 's/_/\ /g'); - link=$(grep "$linkName" $file | cut -d ":" -f 2-3); - fi - if echo $link | grep -q "youtube"; then - link=$(echo $link | sed 's/\ //g'); - if [ "$video" ]; then - #ytplay -v $link -f $format - #format="--ytdl-format=$(grep "$link" $file | cut -d ":" -f 4-)"; - echo "Getting requested video format ID..."; - video=$(yt-dlp --list-formats $link 2>/dev/null | grep "$format" | sed -n '1p' | awk '{printf $1}') - if [ ! "$video" ]; then - echo -e "Getting requested video format ID...[ ${RED}FAILED${ENDCOLOR} ]"; - exit 1; - else - echo -e "Getting requested video format ID...[ ${GREEN}OK${ENDCOLOR} ]"; - fi - - echo "Getting appropiate audio format ID for video..."; - audio=$(yt-dlp --list-formats $link 2>/dev/null | grep 'audio only' | grep "$SYSTEM_CC" | sed -n '1p' | awk '{printf $1}'); - if [ ! "$audio" ]; then - echo -e "Getting audio format based on your locales...[ ${RED}FAILED${ENDCOLOR} ]"; - echo "Getting high quality audio stream format..."; - audio=$(yt-dlp --list-formats $link 2>/dev/null | grep 'audio only' | grep "high" | sed -n '1p' | awk '{printf $1}'); - if [ ! "$audio" ]; then - echo -e "No audio stream found...[ ${RED}FAILED${ENDCOLOR} ]"; - echo -e "There is no separate audio stream...[ ${YELLOW}FINE${ENDCOLOR} ]"; - #exit 1; - else - echo -e "Getting high quality audio stream format...[ ${GREEN}OK${ENDCOLOR} ]"; - fi - else - echo -e "Getting audio format based on your locales...[ ${GREEN}OK${ENDCOLOR} ]"; - fi - if [ ! "$audio" ]; then - fmat="--ytdl-format=${video}"; - else - fmat="--ytdl-format=${video}+${audio}"; - fi - echo "MPV is starting up..."; - mpv $fmat $link > /dev/null 2>&1 & MPVPID=$! - - else - #ytplay -a $link -f best[height=360] - format="--no-video"; - echo "MPV is starting up..."; - mpv $format $link > /dev/null 2>&1 & MPVPID=$! - fi - else - mpv --no-video $link > /tmp/pl.log 2>&1 & MPVPID=$!; - tail -f /tmp/pl.log | grep "icy-title" & - fi - #echo "MPV: $MPVPID"; - done -else - help; - exit 1; -fi - -if [ -f /tmp/playlist.txt ]; then - rm /tmp/playlist.txt; -fi diff --git a/immudex-complete-project/immudex-pl.1.gz b/immudex-complete-project/immudex-pl.1.gz deleted file mode 100644 index 19c6833..0000000 Binary files a/immudex-complete-project/immudex-pl.1.gz and /dev/null differ diff --git a/immudex-complete-project/immudex-run b/immudex-complete-project/immudex-run deleted file mode 100755 index 5f16fdc..0000000 --- a/immudex-complete-project/immudex-run +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/bash - -function help() { - echo "This script allows to run a program with pointed home dir on first"; - echo "opened LUKS partition via immudex-crypt tool. The most programs in"; - echo "Linux write some data in users home dirs. Doing this persistentaly"; - echo "in immudex is imposible, because all default users home dirs came back"; - echo "to state from image and wroted date are gone. Running programs via this"; - echo "scripts makes possible to save this date on first 'crypt'."; - echo "This script can be use to make your own activators easlly."; - echo; - echo "Usage: immudex-run [-h] [-v] program_name [program_args]"; - echo; - echo "Examples:"; - echo " immudex-run firefox-esr Run given program"; - echo " immudex-run -h Print this message"; - echo " immudex-run -v Print information about version, author and copyrights"; - echo; - echo "Report bugs to "; -} - -function version(){ - echo "immudex-run 1.1"; - echo; - echo "Copyright (C) 2026 morketsmerke.org"; - echo "This is free software; see the source for copying conditions. There is NO"; - echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."; - echo; - echo "Written by xf0r3m."; -} - -if [ "$1" ]; then - if [ "$1" = "-h" ]; then - help; - exit 0; - elif [ "$1" = "-v" ]; then - version; - exit 0; - fi -fi - -export HOME=/ic0; -export XDG_CONFIG_HOME=/ic0; -export XDG_CACHE_HOME=/ic0/.cache; -export XDG_CONFIG_DIRS=/ic0/.config; - -program=$1; -shift; -args="$@"; - -$(which $program) ${args}; diff --git a/immudex-complete-project/immudex-run.1.gz b/immudex-complete-project/immudex-run.1.gz deleted file mode 100644 index 252ef0c..0000000 Binary files a/immudex-complete-project/immudex-run.1.gz and /dev/null differ diff --git a/immudex-complete-project/immudex-secured-firefox b/immudex-complete-project/immudex-secured-firefox deleted file mode 100755 index 593956f..0000000 --- a/immudex-complete-project/immudex-secured-firefox +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash - -function help() { - echo "This tool running up a Firefox browser via firejail with sandboxing "; - echo "and forcing network interface to that we use to internet connection."; - echo; - echo "Usage: immudex-secured-firefox [-h] [-v]"; - echo; - echo "Exaples:"; - echo " immudex-secured-firefox Run secured browser."; - echo " immudex-secured-firefox -h Print this message."; - echo " immudex-secured-firefox -v Print information about version, author and copyrights"; - echo; - echo "Report bugs to "; -} - -function version(){ - echo "immudex-secured-firefox 1.1"; - echo; - echo "Copyright (C) 2026 morketsmerke.org"; - echo "This is free software; see the source for copying conditions. There is NO"; - echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."; - echo; - echo "Written by xf0r3m."; -} - -if [ "$1" ]; then - if [ "$1" = "-h" ]; then - help; - exit 0; - elif [ "$1" = "-v" ]; then - version; - exit 0; - fi -fi - -if [ ! -d /tmp/${USER} ]; then - mkdir /tmp/${USER} - cp -prvv /home/${USER}/.mozilla /tmp/${USER} -fi - -eth0=$(ip route show | grep 'default' | awk '{printf $5}'); -firejail --private=/tmp/${USER} --net=$eth0 /usr/lib/firefox-esr/firefox-esr diff --git a/immudex-complete-project/immudex-secured-firefox.1.gz b/immudex-complete-project/immudex-secured-firefox.1.gz deleted file mode 100644 index 9a78d6a..0000000 Binary files a/immudex-complete-project/immudex-secured-firefox.1.gz and /dev/null differ diff --git a/immudex-complete-project/immudex-secured-librewolf b/immudex-complete-project/immudex-secured-librewolf deleted file mode 100755 index b37b615..0000000 --- a/immudex-complete-project/immudex-secured-librewolf +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash - -function help() { - echo "immudex-secured-librewolf, support for LibreWolf version. LibreWolf isn't"; - echo "part of immudex, but this tool officialy existed as a part of project."; - echo; - echo "Usage: immudex-secured-librewolf [-h] [-v]"; - echo; - echo "Examples:"; - echo " immudex-secured-librewolf Run sandboxed LibreWolf browser." - echo " immudex-secured-librewolf -h Print this messages." - echo " immudex-secured-librewolf -v Print information about version, author and copyrights."; - echo; - echo "Report bugs to "; -} - -function version(){ - echo "immudex-secured-librewolf 1.1"; - echo; - echo "Copyright (C) 2026 morketsmerke.org"; - echo "This is free software; see the source for copying conditions. There is NO"; - echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."; - echo; - echo "Written by xf0r3m."; -} - -if [ "$1" ]; then - if [ "$1" = "-h" ]; then - help; - exit; - elif [ "$1" = "-v" ]; then - version; - exit; - fi -fi - - -if [ ! -d /tmp/${USER} ]; then - mkdir /tmp/${USER} - cp -prvv /home/${USER}/.librewolf /tmp/${USER} -fi - -eth0=$(ip route show | grep 'default' | awk '{printf $5}'); -firejail --private=/tmp/${USER} --net=$eth0 /usr/bin/librewolf diff --git a/immudex-complete-project/immudex-secured-librewolf.1.gz b/immudex-complete-project/immudex-secured-librewolf.1.gz deleted file mode 100644 index 7dc236c..0000000 Binary files a/immudex-complete-project/immudex-secured-librewolf.1.gz and /dev/null differ diff --git a/immudex-complete-project/immudex-shoutcasts b/immudex-complete-project/immudex-shoutcasts deleted file mode 100755 index 0e76b45..0000000 --- a/immudex-complete-project/immudex-shoutcasts +++ /dev/null @@ -1,165 +0,0 @@ -#!/bin/bash - -GREEN="\e[32m"; -RED="\e[31m"; -ENDCOLOR="\e[0m"; -BOLD="\e[1m"; -BOLD_GREEN="\e[1;32m"; -BOLD_YELLOW="\e[1;33m"; -BOLD_BLUE="\e[1;34m"; - -function help() { - echo "immudex-shoutcasts script that search internet radios or shoutcasts in two sources xiph.org icecast"; - echo "directory and download .m3u file from radio-browser.info based on a space-separated keywords."; - echo "Data from radio-browser.info are limited to 30 results."; - echo; - echo "Usage: immudex-shoutcasts [-s icecast | radio] [-h] [-v] -k keyword1...keywordN"; - echo; - echo "Options:"; - echo " -s icecast/radio This parameter specifies source, if we want define a source. It can be omitted, then both sources will be searched."; - echo " -k keyword1...keywordsN This parameter is required, it pass keywords to search. Keywords are space-separated."; - echo " -h Print this message."; - echo " -v Print information about version, author and copyrights."; - echo; - echo "Examples:"; - echo " immudex-shoutcasts -k Classic Rock Script will be search internet radios and shoutcast for 'Classic Rock' keywords"; - echo " immudex-shoutcasts -s radio -k lofi Script will be search internet radios (because source is given) for 'lofi' keyword"; - echo; - echo "Files:" - echo " /tmp/icecast.idx Temporary file, store search results from icecast directory for parsing."; - echo " /tmp/radio.idx Temporary file, downloaded .m3u file from radio-browser.info store search results for parsing."; - echo; - echo "Report bugs to "; -} - -function version() { - echo "immudex-shoutcasts 1.1"; - echo; - echo "Copyright (C) 2026 morketsmerke.org"; - echo "This is free software; see the source for copying conditions. There is NO"; - echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."; - echo; - echo "Written by xf0r3m."; -} - - -function getDataBetweenHtmlMarks() { - grep "$1" $2 | sed -n "${3}p" | cut -d ">" -f 2 | cut -d "<" -f 1; -} - -function listOfStations() { - query=$1; - src=$2; - - case $src in - "icecast") wget http://dir.xiph.org/search?q=$query -O /tmp/icecast.idx >> /dev/null 2>&1; - file="/tmp/icecast.idx";; - "radio") wget "https://de1.api.radio-browser.info/m3u/stations/search?limit=30&name=${query}&hidebroken=true&order=clickcount&reverse=true" -O /tmp/radio.idx >> /dev/null 2>&1; - file="/tmp/radio.idx"; - dos2unix $file; - esac - - if [ ! -f $file ]; then - echo -e "${RED}There is no internet connection or sources are currently"; - echo -e "unavailable.${ENDCOLOR}"; - exit 1; - fi - - case $src in - "icecast") amountOfStations=$(grep 'card-title' $file | wc -l);; - "radio") amountOfStations=$(grep '#EXTINF' $file | wc -l);; - esac - - case $src in - "icecast") echo -e "${BOLD}Icecast directory:${ENDCOLOR}";; - "radio") echo -e "${BOLD}radio-browser.info:${ENDCOLOR}";; - esac - - i=1; - while [ $i -le $amountOfStations ]; do - case $src in - "icecast") stationName=$(getDataBetweenHtmlMarks 'card-title' $file $i);; - "radio") stationName=$(grep '#EXTINF' $file | sed -n "${i}p" | cut -d "," -f 2-);; - esac - if [ "$src" = "icecast" ]; then - whatIsPlayingNow=$(getDataBetweenHtmlMarks 'card-subtitle' $file $i); - fi - case $src in - "icecast") link=$(grep 'Play' $file | sed -n "${i}p" | cut -d '"' -f 2);; - "radio") link=$(grep '://' $file | sed -n "${i}p");; - esac - echo -e "${BOLD}${i}.${ENDCOLOR} ${BOLD_YELLOW}${stationName}${ENDCOLOR}"; - if [ "$whatIsPlayingNow" ]; then - echo -e "\t${BOLD}Now playing:${ENDCOLOR} ${BOLD_BLUE}${whatIsPlayingNow}${ENDCOLOR}"; - unset whatIsPlayingNow; - fi - echo -e "\t${BOLD}Link:${ENDCOLOR} ${BOLD_GREEN}${link}${ENDCOLOR}"; - i=$(expr $i + 1); - done - unset i; - echo; -} - -if [ "$1" ]; then - - if [ "$1" ] && [ "$1" = "-h" ]; then - help; - exit 0; - elif [ "$1" ] && [ "$1" = "-v" ]; then - version; - exit 0; - fi - - option=$1; - if [ "$option" = "-s" ]; then - shift; - src=$1; - shift 2; - search=$* - elif [ "$option" = "-k" ]; then - shift; - search=$*; - fi -else - help; - exit 1; -fi - -if [ "$src" ]; then - listOfStations "$search" $src; - if [ "$src" = "icecast" ]; then - file="/tmp/icecast.idx"; - else - file="/tmp/radio.idx"; - fi -else - listOfStations "$search" 'icecast'; - listOfStations "$search" 'radio'; - - PS3="source? "; - select src in 'icecast' 'radio'; do - case $src in - 'icecast') file="/tmp/icecast.idx";; - 'radio') file="/tmp/radio.idx";; - *) exit 0; - esac - break - done -fi - -echo -n "Station? "; -read station; -if $(echo $station | grep -q '[0-9]') && [ $station -le 30 ]; then - case $file in - '/tmp/icecast.idx') link=$(grep 'Play' $file | sed -n "${station}p" | cut -d '"' -f 2);; - '/tmp/radio.idx') link=$(grep '://' $file | sed -n "${station}p");; - esac - case $src in - "icecast") stationName=$(getDataBetweenHtmlMarks 'card-title' $file $station);; - "radio") stationName=$(grep '#EXTINF' $file | sed -n "${station}p" | cut -d "," -f 2-);; - esac - echo -e "${BOLD}Station:${ENDCOLOR} ${BOLD_YELLOW}${stationName}${ENDCOLOR}"; - mpv --no-video $link; -else - exit 0; -fi diff --git a/immudex-complete-project/immudex-shoutcasts.1.gz b/immudex-complete-project/immudex-shoutcasts.1.gz deleted file mode 100644 index 7696ca5..0000000 Binary files a/immudex-complete-project/immudex-shoutcasts.1.gz and /dev/null differ diff --git a/immudex-complete-project/immudex-upgrade b/immudex-complete-project/immudex-upgrade deleted file mode 100755 index b27dfa3..0000000 --- a/immudex-complete-project/immudex-upgrade +++ /dev/null @@ -1,146 +0,0 @@ -#!/bin/bash - -set -e - -source library.sh - -RED="\e[31m"; -GREEN="\e[32m"; -YELLOW="\e[33m"; -ENDCOLOR="\e[0m"; -root="/run/live/medium"; - -function help() { - echo "Script for searching upgrades and upgrade immudex."; - echo "Superuser (root) privileges are required."; - echo; - echo "Usage: immudex-upgrade [-c] [-d] [-h] [-m] [-p] [-s] [-u] [-v]"; - echo; - echo "Options:"; - echo " -c Check there are upgrades for immudex"; - echo " -d Prints date of image creation"; - echo " -h Prints this message."; - echo " -m Prints image details"; - echo " -p Updates apt (packages) list and prints available to upgrade packages."; - echo " -s Updates apt (packages) list and prints only packages upgrades from security repository branch"; - echo " -u Upgrade immudex from given source"; - echo " -v Prints information about version, author and copyrights."; - echo; - echo "Report bugs to "; -} - -function version(){ - echo "immudex-upgrade 1.1"; - echo; - echo "Copyright (C) 2026 morketsmerke.org"; - echo "This is free software; see the source for copying conditions. There is NO"; - echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."; - echo; - echo "Written by xf0r3m."; -} - -if [ $UID -ne 0 ]; then - echo "Permission denied!"; - help; - exit 1; -fi - -if [ "$1" ]; then - if [ "$1" = "-h" ]; then - help; - exit 0; - elif [ "$1" = "-v" ]; then - version; - exit 0; - fi - if [ "$1" ] && [ "$1" = "-c" ]; then - if check_distro_commit; then - echo -e "${GREEN}This${ENDCOLOR} is the latest version of immudex"; - else - echo -e "There is a ${RED}new${ENDCOLOR} version of immudex:"; - echo "==================================================="; - check_distro_commit --print; - fi - elif [ "$1" ] && [ "$1" = "-u" ]; then - part=$(blkid | grep 'LABEL="immudex"' | awk '{printf $1}' | cut -d ":" -f 1); - if mount | grep -q "$part"; then - echo -n "Mounting iso image..."; - mount $2 /mnt > /dev/null 2>&1; - if [ $? -eq 0 ]; then echo -e "[ ${GREEN}OK${ENDCOLOR} ]"; fi - mountPointList=$(mount | grep "$part" | awk '{printf $3" "}'); - for mountPoint in $mountPointList; do - echo -n "Unlocking $mountPoint ..."; - mount $part $mountPoint -o remount,rw > /dev/null 2>&1; - if [ $? -eq 0 ]; then - echo -e "[ ${GREEN}OK${ENDCOLOR} ]"; - else - echo -e "[ ${RED}FAIL${ENDCOLOR} ]"; - fi - done - echo "Copying immudex files to the disk..."; - cp -vv /mnt/live/* ${mountPoint}/live; - if [ $? -eq 0 ]; then - echo -e "Copying immudex files to the disk...[ ${GREEN}OK${ENDCOLOR} ]"; - else - echo -e "Copying immudex files to the disk...[ ${RED}FAIL${ENDCOLOR} ]"; - fi - else - echo -n "Mounting immudex partition..."; - mount $part /mnt >> /dev/null 2>&1; - if [ $? -eq 0 ]; then echo -e "[ ${GREEN}OK${ENDCOLOR} ]"; fi - echo "Copying immudex files to the disk..."; - cp -vv /run/live/medium/live/* /mnt/live; - if [ $? -eq 0 ]; then - echo -e "Copying immudex files to the disk...[ ${GREEN}OK${ENDCOLOR} ]"; - else - echo -e "Copying immudex files to the disk...[ ${RED}FAIL${ENDCOLOR} ]"; - fi - fi - if $(sudo efibootmgr > /dev/null 2>&1); then - echo "Copying grub config to the disk..."; - if [ "$mountPoint" ]; then - cp -vv /mnt/boot/grub/grub.cfg ${mountPoint}/boot/grub/grub.cfg; - if [ $? -eq 0 ]; then - echo -e "Copying grub config to the disk...[ ${GREEN}OK${ENDCOLOR} ]"; - sed -i '/set\ timeout=/ s/30/5/' ${mountPoint}/boot/grub/grub.cfg; - sed -i 's/bootfrom=removable //g' ${mountPoint}/boot/grub/grub.cfg; - else - echo -e "Copying grub config to the disk...[ ${RED}FAIL${ENDCOLOR} ]"; - fi - else - cp -vv /run/live/medium/boot/grub/grub.cfg /mnt/boot/grub/grub.cfg; - if [ $? -eq 0 ]; then - echo -e "Copying grub config to the disk...[ ${GREEN}OK${ENDCOLOR} ]"; - sed -i '/set\ timeout=/ s/30/5/' /mnt/boot/grub/grub.cfg; - sed -i 's/bootfrom=removable //g' /mnt/boot/grub/grub.cfg; - else - echo -e "Copying grub config to the disk...[ ${RED}FAIL${ENDCOLOR} ]"; - fi - fi - fi - elif [ "$1" ] && [ "$1" = "-m" ]; then - #if [ -d /tmp/immudex ]; then - # (cd /tmp/immudex && git pull > /dev/null 2>&1) - #else - # git clone https://github.com/xf0r3m/immudex /tmp/immudex; - #fi - #(cd /tmp/immudex && git show $(cat /run/live/medium/live/version)) - cat /run/live/medium/live/changelog; - elif [ "$1" ] && [ "$1" = "-p" ]; then - apt update; - apt list --upgradable; - elif [ "$1" ] && [ "$1" = "-s" ]; then - apt update; - apt list --upgradable | grep 'security'; - elif [ "$1" ] && [ "$1" = "-d" ]; then - eval $(grep '^COMPILATION_DATE' /run/live/medium/live/changelog); - echo "Image was created: $COMPILATION_DATE"; - else - help; - exit 1; - fi -else - help; - exit 1; -fi - diff --git a/immudex-complete-project/immudex-upgrade.1.gz b/immudex-complete-project/immudex-upgrade.1.gz deleted file mode 100644 index 1ed7348..0000000 Binary files a/immudex-complete-project/immudex-upgrade.1.gz and /dev/null differ diff --git a/immudex-complete-project/immudex-version b/immudex-complete-project/immudex-version deleted file mode 100755 index 2e7d497..0000000 --- a/immudex-complete-project/immudex-version +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash - -function help() { - echo "Script returns first 7 signs of immudex commit ID."; - echo; - echo "Usage: immudex-version [-h] [-v]"; - echo; - echo "Options:"; - echo " -h Print this message."; - echo " -v Print information about version, author and copyrights."; - echo; - echo "Files:"; - echo " /run/live/medium/live/changelog Stores information about currently running immudex image."; - echo; - echo "Report bugs to "; -} - -function version(){ - echo "immudex-version 1.1"; - echo; - echo "Copyright (C) 2026 morketsmerke.org"; - echo "This is free software; see the source for copying conditions. There is NO"; - echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."; - echo; - echo "Written by xf0r3m."; -} - -if [ "$1" ]; then - if [ "$1" = "-h" ]; then - help; - exit 0; - elif [ "$1" = "-v" ]; then - version; - exit 0; - fi -fi - -eval $(grep '^COMMIT' /run/live/medium/live/changelog) -echo $COMMIT | awk '{printf $1}' | cut -c 1-7 diff --git a/immudex-complete-project/immudex-version.1.gz b/immudex-complete-project/immudex-version.1.gz deleted file mode 100644 index 281a77a..0000000 Binary files a/immudex-complete-project/immudex-version.1.gz and /dev/null differ diff --git a/immudex-complete-project/immudex-ytplay b/immudex-complete-project/immudex-ytplay deleted file mode 100755 index 29901e2..0000000 --- a/immudex-complete-project/immudex-ytplay +++ /dev/null @@ -1,131 +0,0 @@ -#!/usr/bin/env python3 - -import sys -import subprocess -import re -from youtube_search import YoutubeSearch - -def usage(): - - print('''immudex-ytplay script for playing a video or audio track from YouTube. Script -can search based on given keywords and return list of results. User choose -one of result or repeats searching with 'r' || 'R' answer to number from -list result. Then script quering YouTube for available formats and table -with possible format are printed. User have to put video and audio quality -from table in requested format: videoQualityID+audioQualityID. There are -a hint. Script is half-interactive. - -Usage: immudex-ytplay [-a youtube_link] [-h] [-i] [-s 'keyword1...keywordN' -v | -a] [-v youtube_link] - -Options: - -a YouTube_Link Play only YouTube video audiotrack. - -h Print this message. - -i Print information about version, author and copyrights. - -s 'keyword1...keywordN' -v/-a Search given keywords on YouTube and play video or audiotrack. - -v YouTube_Link Play YouTube video. - -Examples: - immudex-ytplay -s 'lofi' -a Script will be search a lofi keyword in YouTube and play only audio tracks from choosen video. - immudex-ytplay -v https://youtube.com/watch?v=... Script will be play a video from given link, of course is publicly available. - immudex-ytplay -a https://youtube.com/watch?v=... Script will be play a audio track from given video link. The principle of video playback also applies here. - -Report bugs to ''') - -def version(): - print('''immudex-ytplay 1.0 - -Copyright (C) 2026 morketsmerke.org -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -Written by xf0r3m.''') - -def ytSearch(keywords, maxResults=15): - - i = "r" - while isinstance(i, str) and (i == "r" or i == "R"): - subprocess.run('clear') - results = YoutubeSearch(keywords, max_results=maxResults).to_dict() - - index = 1 - for video in results: - print(f"\033[1m\033[91m{index}\033[0m. Title: \033[92m{video['title']}\033[0m") - print(f" Channel: \033[93m{video['channel']}\033[0m, Duration: \033[94m{video['duration']}\033[0m, PubDate: \033[95m{video['publish_time']}\033[0m") - index += 1 - - i = input("Put number of video you wanna watch or put 'r' | 'R' to reload search result or send any other key to quit: ") - if isinstance(i, str) and i != 'r' and i != 'R' and not re.search("[0-9]+", i): - sys.exit(0) - - i = int(i) - 1 - return(results[i]['id'], results[i]['title'], results[i]['channel'], results[i]['duration'], results[i]['publish_time']) - -def getFormat(videoID): - subprocess.run(['yt-dlp', '--list-formats', 'https://youtube.com/watch?v=' + videoID]) - f = input("Please choose youtube video format, you need put video+audio ID of quality in this format or type anything else to quit:") - if not re.search("[0-9]{3}\+[0-9]{3}|[0-9]{2}", f): - sys.exit(0) - else: - return f - -if len(sys.argv) == 2: - if sys.argv[1] == '-h': - usage() - sys.exit(0) - elif sys.argv[1] == '-i': - version() - sys.exit(0) - -if len(sys.argv) < 2: - usage() - sys.exit(2) - -option=sys.argv[1] - -if option == '-s': - if len(sys.argv) > 2: - if sys.argv[2] == '-v': - mode = "video" - elif sys.argv[2] == '-a': - mode = "audio" - else: - usage() - sys.exit(2) - keywords = sys.argv[1] - - video = ytSearch(keywords) - subprocess.run('clear') - - if mode == 'audio': - ytFormat = "--no-video" - else: - ytFormat = "--ytdl-format=" + getFormat(video[0]) - - subprocess.run('clear') - print(f"\033[91m1\033[0m. Title: \033[92m{video[1]}\033[0m") - print(f" Channel: \033[93m{video[2]}\033[0m, Duration: \033[94m{video[3]}\033[0m, PubDate: \033[95m{video[4]}\033[0m") - print("===================================================================") - - subprocess.run(['mpv', ytFormat, 'https://youtube.com/watch?v=' + video[0]]) - else: - usage() - sys.exit(2) - -elif sys.argv[1] == '-a': - if len(sys.argv) > 2: - link=sys.argv[2] - ytFormat="--no-video" - subprocess.run(['mpv', ytFormat, link]) - else: - usage() - sys.exit(2) - -elif sys.argv[1] == '-v': - if len(sys.argv) > 2: - link=sys.argv[2] - videoID=link[-11:] - ytFormat="--ytdl-format=" + getFormat(videoID) - subprocess.run(['mpv', ytFormat, link]) - else: - usage() - sys.exit(2) diff --git a/immudex-complete-project/immudex-ytplay.1.gz b/immudex-complete-project/immudex-ytplay.1.gz deleted file mode 100644 index edbdfa1..0000000 Binary files a/immudex-complete-project/immudex-ytplay.1.gz and /dev/null differ diff --git a/immudex-complete-project/library.sh b/immudex-complete-project/library.sh deleted file mode 100755 index 1ba9ed8..0000000 --- a/immudex-complete-project/library.sh +++ /dev/null @@ -1,100 +0,0 @@ -#!/bin/bash - - -#function help() { -# echo "This script does noting. It's a collection of functions uses by"; -# echo "other tools, by import this file into it self. Man page for this script"; -# echo "can be usefull for describe above mentioned functions."; -# echo; -# echo "Notes:"; -# echo -e " get_debian_branch() Can be used for convert Debian codename for Debian branch name\n"; -# echo -e " get_machine_arch() Used for getting information is this 32 or 64-bit architecture.\n"; -# echo -e " check_distro_commit() Is used for decide that you use a latest version immudex if there are commit ahead your image, this script returns 0, otherwise 1.\n"; -# echo -e " ascii_colors() Prints immudex name in ASCII manuali.\n"; -# echo; -# echo "Usage: source /usr/local/bin/library.sh"; -# echo; -# echo "Options:"; -# echo " There is no options... Function help and version are used only for generate man page file and will be comment out after this."; -# echo; -# echo "Report bugs to "; -#} - -#function version(){ -# echo "library.sh 1.0"; -# echo; -# echo "Copyright (C) 2026 morketsmerke.org"; -# echo "This is free software; see the source for copying conditions. There is NO"; -# echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."; -# echo; -# echo "Written by xf0r3m."; -#} - - -function get_debian_branch() { - if grep -q 'trixie' /etc/os-release; then - echo "testing"; - elif grep -q 'bookworm' /etc/os-release; then - echo "stable"; - else - echo "oldstable"; - fi -} - -function get_machine_arch() { - arch=$(uname -m); - if [ "$arch" = "i686" ]; then - echo "32"; - else - echo "64"; - fi -} - -function check_distro_commit() { - versionFile="/run/live/medium/live/version"; - if [ -f $versionFile ]; then - localVersion=$(cat $versionFile); - if [ -d /tmp/immudex ]; then - $(cd /tmp/immudex && git pull -q); - else - git clone -q https://github.com/xf0r3m/immudex /tmp/immudex; - fi - latestVersion=$(cd /tmp/immudex && git log --pretty=oneline | head -1 | cut -d " " -f 1); - if [ "$1" ] && [ "$1" == "--print" ]; then - echo "$(cd /tmp/immudex && git log ${localVersion}..${latestVersion})"; - fi - if [ "$localVersion" = "$latestVersion" ]; then - return 0; - else - return 1; - fi - else - return 255; - fi -} - -function ascii_colors() { - - BLUE="\e[1;94m"; - RED="\e[1;91m"; - CYAN="\e[1;96m"; - ENDCOLOR="\e[0m"; - - echo -e "${BLUE} _ ${RED} _ ${CYAN} ${ENDCOLOR}"; - echo -e "${BLUE}(_)_ __ ___ _ __ ___ _ _ ${RED} __| | ___${CYAN}__ __${ENDCOLOR}"; - echo -e "${BLUE}| | '_ \` _ \| '_ \` _ \| | | |${RED}/ _\` |/ _ \\\\${CYAN} \/ /${ENDCOLOR}"; - echo -e "${BLUE}| | | | | | | | | | | | |_| |${RED} (_| | __/${CYAN}> < ${ENDCOLOR}"; - echo -e "${BLUE}|_|_| |_| |_|_| |_| |_|\__,_|${RED}\__,_|\___/${CYAN}_/\_\\"; - echo -e "${ENDCOLOR}"; - -} - -#if [ "$1" ]; then -# if [ "$1" = "--help" ]; then -# help; -# exit 0; -# elif [ "$1" = "--version" ]; then -# version; -# exit 0; -# fi -#fi diff --git a/tools/bin/immudex-branch b/tools/bin/immudex-branch index 0c0c876..3c49dc2 100755 --- a/tools/bin/immudex-branch +++ b/tools/bin/immudex-branch @@ -5,22 +5,22 @@ function help() { echo "used for build immudex. This information is used in 'Info:' section"; echo "in conky widget as complement in name of immudex version."; echo; - echo "Usage: immudex-branch [--help] [--version]"; + echo "Usage: immudex-branch [-h] [-v]"; echo; echo "Options:"; - echo " --help Print this message."; - echo " --version Print information about version, author and copyrights."; + echo " -h Print this message."; + echo " -v Print information about version, author and copyrights."; echo; echo "Examples:"; echo " immudex-branch Prints version of Debian used for immudex build with hyphen on start of." - echo " immudex-branch --help Prints this message."; - echo " immudex-branch --version Print information about version, author and copyrights."; + echo " immudex-branch -h Prints this message."; + echo " immudex-branch -v Print information about version, author and copyrights."; echo; echo "Report bugs to "; } function version() { - echo "immudex-branch 1.0"; + echo "immudex-branch 1.1"; echo; echo "Copyright (C) 2026 morketsmerke.org"; echo "This is free software; see the source for copying conditions. There is NO"; @@ -31,9 +31,9 @@ function version() { } if [ "$1" ]; then - if [ "$1" = "--help" ]; then + if [ "$1" = "-h" ]; then help; - elif [ "$1" = "--version" ]; then + elif [ "$1" = "-v" ]; then version; fi else diff --git a/tools/bin/immudex-cdrip b/tools/bin/immudex-cdrip index 8ef6186..5b54966 100755 --- a/tools/bin/immudex-cdrip +++ b/tools/bin/immudex-cdrip @@ -12,26 +12,26 @@ function help() { echo "Script apart form ripping Audio CD's, reads metadata, check it on music"; echo "databases and creates properly named directories and audio files."; echo; - echo "Usage: immudex-cdrip [--rip-only] [--get-disc-info] [--rip-n-rename] [--help] [--version]"; + echo "Usage: immudex-cdrip [-g] [-h] [-o] [-r] [-v]"; echo; echo "Options:"; - echo " --rip-only Rips audio tracks from Audio CD, without quering CDIndex (MusicBrainz) database."; - echo " --get-disc-info Getting info from CDIndex (MusicBrainz) database about Audio CD without ripping."; - echo " --rip-n-rename Rips audio tracks from Audio CD, create Artist/Album folders and rename tracks according to data get CDIndex (MusicBrainz) database (normal usage)."; - echo " --help Print this message."; - echo " --version Print information about version, author and copyrights."; + echo " -g Getting metadata from Audio CD without ripping."; + echo " -h Print this message."; + echo " -o Rips audio tracks from Audio CD, without renaming based Audio CD metadata"; + echo " -r Rips audio tracks from Audio CD, create Artist/Album folders and rename tracks according to AudioCD metadata."; + echo " -v Print information about version, author and copyrights."; echo; echo "Examples:"; echo " immudex-cdrip Print this message"; - echo " immudex-cdrip --get-disc-info Check is in MusicBrainz DB, are there any data about puted CD in drive."; - echo " Could be useful with less popular artists."; - echo " immudex-cdrip --rip-n-rename Rips Audio CD and names dirs and files with MusicBrainz data."; + echo " immudex-cdrip -g Get metadata from Audio CD"; + echo " immudex-cdrip -o Rip tracks form Audio CD, without renaming. Could be useful with less popular artists."; + echo " immudex-cdrip -r Rips Audio CD and names dirs and files with Audio CD data."; echo; echo "Report bugs to "; } function version() { - echo "immudex-cdrip 1.0"; + echo "immudex-cdrip 1.1"; echo; echo "Copyright (C) 2026 morketsmerke.org"; echo "This is free software; see the source for copying conditions. There is NO"; @@ -135,12 +135,12 @@ if [ "$1" ] && [ "$1" = "--rip-n-rename" ]; then exit 0; fi -if [ "$1" ] && [ "$1" = "--help" ]; then +if [ "$1" ] && [ "$1" = "-h" ]; then help; exit 0; fi -if [ "$1" ] && [ "$1" = "--version" ]; then +if [ "$1" ] && [ "$1" = "-v" ]; then version; exit 0; fi diff --git a/tools/bin/immudex-import-gpgkeys b/tools/bin/immudex-import-gpgkeys index 89b6773..e653a6b 100755 --- a/tools/bin/immudex-import-gpgkeys +++ b/tools/bin/immudex-import-gpgkeys @@ -7,22 +7,22 @@ function help() { echo "Script requires to store GPG keys in home dir or change home dir before"; echo "execute a script."; echo; - echo "Usage: immudex-import-gpgkeys [--help] [--version]"; + echo "Usage: immudex-import-gpgkeys [-h] [-v]"; echo; echo "Options:"; - echo " --help Print this message."; - echo " --version Print information about version, author and copyrights"; + echo " -h Print this message."; + echo " -v Print information about version, author and copyrights"; echo; echo "Examples:"; - echo " immudex-import-gpgkeys Import GPG keys and owner trust."; - echo " immudex-import-gpgkeys --help Print this message."; - echo " immudex-import-gpgkeys --version Print information about version, author and copyrights."; + echo " immudex-import-gpgkeys Import GPG keys and owner trust."; + echo " immudex-import-gpgkeys -h Print this message."; + echo " immudex-import-gpgkeys -v Print information about version, author and copyrights."; echo; echo "Report bugs to "; } function version() { - echo "immudex-import-gpgkeys 1.0"; + echo "immudex-import-gpgkeys 1.1"; echo; echo "Copyright (C) 2026 morketsmerke.org"; echo "This is free software; see the source for copying conditions. There is NO"; @@ -32,9 +32,9 @@ function version() { } if [ "$1" ]; then - if [ "$1" = "--help" ]; then + if [ "$1" = "-h" ]; then help; - elif [ "$1" = "--version" ]; then + elif [ "$1" = "-v" ]; then version; fi else diff --git a/tools/bin/immudex-import-sshkeys b/tools/bin/immudex-import-sshkeys index 91e1c2b..6f7a72d 100755 --- a/tools/bin/immudex-import-sshkeys +++ b/tools/bin/immudex-import-sshkeys @@ -4,24 +4,24 @@ function help() { echo "it's a script for copying OpenSSH client files such as keys and config file into user native home directory."; echo "This command should be run in other home directory, where ssh keys are stored."; echo; - echo "Usage: immudex-import-sshkeys [--import-hosts] [--help] [--version]"; + echo "Usage: immudex-import-sshkeys [-i] [-h] [-v]"; echo; echo "Options:"; - echo " --import-hosts Import hostnames and adresses to /etc/host file (sudo required) from SSH config file if exist."; - echo " --help Print this message."; - echo " --version Print information about version, author and copyrights."; + echo " -i Import hostnames and adresses to /etc/host file (sudo required) from SSH config file if exist."; + echo " -h Print this message."; + echo " -v Print information about version, author and copyrights."; echo; echo "Examples:"; - echo " immudex-import-sshkeys Import OpenSSH client files into user native home dir."; - echo " immudex-import-sshkeys --import-hosts Import OpenSSH client files and create DNS resolve database in /etc/hosts by taking data from OpenSSH client config file, if exist."; - echo " immudex-import-sshkeys --help Print this message."; - echo " immudex-import-sshkeys --version Print information about version, author and copyrights." + echo " immudex-import-sshkeys Import OpenSSH client files into user native home dir."; + echo " immudex-import-sshkeys -i Import OpenSSH client files and create DNS resolve database in /etc/hosts by taking data from OpenSSH client config file, if exist."; + echo " immudex-import-sshkeys -h Print this message."; + echo " immudex-import-sshkeys -v Print information about version, author and copyrights." echo; echo "Report bugs to "; } function version() { - echo "immudex-import-sshkeys 1.0"; + echo "immudex-import-sshkeys 1.1"; echo; echo "Copyright (C) 2026 morketsmerke.org"; echo "This is free software; see the source for copying conditions. There is NO"; @@ -31,9 +31,9 @@ function version() { } if [ "$1" ]; then - if [ "$1" = "--help" ]; then + if [ "$1" = "-h" ]; then help; - elif [ "$1" = "--version" ]; then + elif [ "$1" = "-v" ]; then version; fi else diff --git a/tools/bin/immudex-meteo b/tools/bin/immudex-meteo index 9fbefb5..c040f6d 100755 --- a/tools/bin/immudex-meteo +++ b/tools/bin/immudex-meteo @@ -5,25 +5,25 @@ function help() { echo "The weather status is availabel to get in 3 formats described below"; echo "in options."; echo; - echo "Usage: immudex-meteo [--short | --long | --micro location] [--help] [--version]"; + echo "Usage: immudex-meteo [-h] [-l|-m|-s location] [-v]"; echo; echo "Options:"; - echo " --short location Short human readable format with one small ascii art."; - echo " --long location Long format, more readable, weather for every stage of the day and 2-day forecast"; - echo " --micro location Micro format, one line with details (current weather)"; - echo " --help Prints this message"; - echo " --version Prints information about version, author and copyrights"; + echo " -h Prints this message"; + echo " -l location Long format, more readable, weather for every stage of the day and 2-day forecast"; + echo " -m location Micro format, one line with details (current weather)"; + echo " -s location Short human readable format with one small ascii art."; + echo " -v Prints information about version, author and copyrights"; echo; echo "Exmaples:"; - echo " immudex-meteo --short London Current weather in London in short format."; - echo " immudex-meteo --long Berlin Weather for whole day in Berlin and 2-day forecast."; - echo " immudex-meteo --micro Warszawa One line with weather information from Warsaw, good for motd's or resources monitors."; + echo " immudex-meteo -s London Current weather in London in short format."; + echo " immudex-meteo -l Berlin Weather for whole day in Berlin and 2-day forecast."; + echo " immudex-meteo -m Warszawa One line with weather information from Warsaw, good for motd's or resources monitors."; echo; echo "Report bugs to "; } function version() { - echo "immudex-meteo 1.0-1"; + echo "immudex-meteo 1.1"; echo; echo "Copyright (C) 2026 morketsmerke.org"; echo "This is free software; see the source for copying conditions. There is NO"; @@ -34,11 +34,11 @@ function version() { if [ "$1" ]; then case $1 in - "--short") curl wttr.in/${2}?0\&lang=pl;; - "--long") curl wttr.in/${2}?lang=pl;; - "--micro") curl wttr.in/${2}?format=4;; - "--help") help; exit 0;; - "--version") version; exit 0;; + "-s") curl wttr.in/${2}?0\&lang=pl;; + "-l") curl wttr.in/${2}?lang=pl;; + "-m") curl wttr.in/${2}?format=4;; + "-h") help; exit 0;; + "-v") version; exit 0;; *) help; exit 1;; esac else diff --git a/immudex-complete-project/immudex-morketsmerke b/tools/bin/immudex-morketsmerke similarity index 100% rename from immudex-complete-project/immudex-morketsmerke rename to tools/bin/immudex-morketsmerke diff --git a/tools/bin/immudex-motd b/tools/bin/immudex-motd index cbec9c8..0d3fa8c 100755 --- a/tools/bin/immudex-motd +++ b/tools/bin/immudex-motd @@ -2,16 +2,16 @@ if [ "$1" ]; then - if [ "$1" = "--help" ]; then + if [ "$1" = "-h" ]; then echo "immudex-motd prints configurable message of the day."; echo "Information and its quantity can be changed via the configuration file."; echo "Script using figlet basic font and lolcat for print header of message."; echo; - echo "Usage: immudex-motd [--help] [--version]"; + echo "Usage: immudex-motd [-h] [-v]"; echo; echo "Options:"; - echo " --help Print this message."; - echo " --version Print information about version, author and copyright"; + echo " -h Print this message."; + echo " -v Print information about version, author and copyright"; echo; echo "Files:"; echo " /etc/motd.conf Script configuration file."; @@ -23,8 +23,8 @@ if [ "$1" ]; then echo "Report bugs to "; exit 0; fi - if [ "$1" = "--version" ]; then - echo "immudex-motd 1.0"; + if [ "$1" = "-v" ]; then + echo "immudex-motd 1.1"; echo; echo "Copyright (C) 2026 morketsmerke.org"; echo "This is free software; see the source for copying conditions. There is NO"; diff --git a/tools/bin/immudex-padlock b/tools/bin/immudex-padlock index 92e6446..36254e5 100755 --- a/tools/bin/immudex-padlock +++ b/tools/bin/immudex-padlock @@ -15,12 +15,12 @@ function help(){ echo "is implemented inside the script, you don't needed to launch this"; echo "via sudo."; echo; - echo "Usage: immudex-padlock [--help] [--version]"; + echo "Usage: immudex-padlock [-h] [-v]"; echo; echo "Example:"; echo " immudex-padlock Standard script execution, explained above."; - echo " immudex-padlock --help Print this message."; - echo " immudex-padlock --version Print information about version, author and copyrights."; + echo " immudex-padlock -h Print this message."; + echo " immudex-padlock -v Print information about version, author and copyrights."; echo; echo "Files:"; echo " /usr/share/icons/padlock-icon.png Symlink, original launcher icon."; @@ -28,11 +28,11 @@ function help(){ echo " /usr/share/icons/changes-allow.png Original, open padlock icon."; echo " /etc/skel/.config/xfce4/panel/launcher-14/16844255236.desktop XFCE4 bottom panel script activator."; echo; - echo "Report bugs to "; + echo "Report bugs to "; } function version(){ - echo "immudex-padlock 1.0"; + echo "immudex-padlock 1.1"; echo; echo "Copyright (C) 2026 morketsmerke.org"; echo "This is free software; see the source for copying conditions. There is NO"; @@ -44,8 +44,8 @@ function version(){ launcher="/home/${USER}/.config/xfce4/panel/launcher-14/16844255236.desktop"; function main_unlock() { - sudo /usr/local/sbin/immudex-crypt --open=$1; - index=$(basename $(sudo /usr/local/sbin/immudex-crypt --list | grep "$1" | head -1 | awk '{printf $2}' | grep -o '[0-9]')); + sudo /usr/local/sbin/immudex-crypt -o $1; + index=$(basename $(sudo /usr/local/sbin/immudex-crypt -l | grep "$1" | head -1 | awk '{printf $2}' | grep -o '[0-9]')); #sudo mkdir -p /media/${USER}/$devName; #sudo mount /dev/mapper/$devName /media/${USER}/$devName; @@ -106,9 +106,9 @@ function lock() { } if [ "$1" ]; then - if [ "$1" = "--help" ]; then + if [ "$1" = "-h" ]; then help; - elif [ "$1" = "--version" ]; then + elif [ "$1" = "-v" ]; then version; fi else diff --git a/tools/bin/immudex-pl b/tools/bin/immudex-pl index e6dce63..077db0e 100755 --- a/tools/bin/immudex-pl +++ b/tools/bin/immudex-pl @@ -16,25 +16,25 @@ function help() { echo "not need to be stored on the target device. Script will delete the"; echo "file at the end of its execution. "; echo; - echo "Usage: immudex-pl [--video --format=240p...1080p] [--help] [--version] link-list"; + echo "Usage: immudex-pl [-h] [-i] [-v youtube_video_quality] link-list"; echo; echo "Options:"; - echo " --video --format=240p...1080p Open link as video."; - echo " --help Print this message."; - echo " --version Print information about version, author and copyrights."; + echo " -v 240p...1080p Open link as video."; + echo " -h Print this message."; + echo " -i Print information about version, author and copyrights."; echo; echo "Files:"; echo " /usr/share/doc/immudex-pl/links.list.example Example link list file."; echo; echo "Examples:" echo " immudex-pl ~/radio-links.txt Open given link list as audio stream."; - echo " immudex-pl --video --format=360p ./yt-links Open given link list as video in 360p format."; + echo " immudex-pl -v 360p ./yt-links Open given link list as video in 360p format."; echo; echo "Report bugs to "; } function version() { - echo "immudex-pl 1.0-1"; + echo "immudex-pl 1.1"; echo; echo "Copyright (C) 2026 morketsmerke.org"; echo "This is free software; see the source for copying conditions. There is NO"; @@ -43,18 +43,18 @@ function version() { echo "Written by xf0r3m."; } -if [ "$1" ] && [ $1 = "--video" ]; then +if [ "$1" ] && [ $1 = "-v" ]; then video=1; shift; - if $(echo $1 | grep -q '\-\-format'); then - format=$(echo $1 | grep -o '[0-9]' | awk '{printf $1}') + if $(echo $1 | grep -q '[0-9]*p'); then + format=$(echo $1 | sed 's/p//g') fi shift; file=$1; -elif [ "$1" ] && [ $1 = "--help" ]; then +elif [ "$1" ] && [ $1 = "-h" ]; then help; exit 0; -elif [ "$1" ] && [ $1 = "--version" ]; then +elif [ "$1" ] && [ $1 = "-i" ]; then version; exit 0; else diff --git a/tools/bin/immudex-run b/tools/bin/immudex-run index c0fa3e4..5f16fdc 100755 --- a/tools/bin/immudex-run +++ b/tools/bin/immudex-run @@ -9,18 +9,18 @@ function help() { echo "scripts makes possible to save this date on first 'crypt'."; echo "This script can be use to make your own activators easlly."; echo; - echo "Usage: immudex-run [--help] [--version] program_name [program_args]"; + echo "Usage: immudex-run [-h] [-v] program_name [program_args]"; echo; echo "Examples:"; echo " immudex-run firefox-esr Run given program"; - echo " immudex-run --help Print this message"; - echo " immudex-run --version Print information about version, author and copyrights"; + echo " immudex-run -h Print this message"; + echo " immudex-run -v Print information about version, author and copyrights"; echo; echo "Report bugs to "; } function version(){ - echo "immudex-run 1.0"; + echo "immudex-run 1.1"; echo; echo "Copyright (C) 2026 morketsmerke.org"; echo "This is free software; see the source for copying conditions. There is NO"; @@ -30,10 +30,10 @@ function version(){ } if [ "$1" ]; then - if [ "$1" = "--help" ]; then + if [ "$1" = "-h" ]; then help; exit 0; - elif [ "$1" = "--version" ]; then + elif [ "$1" = "-v" ]; then version; exit 0; fi diff --git a/tools/bin/immudex-secured-firefox b/tools/bin/immudex-secured-firefox index 32720aa..593956f 100755 --- a/tools/bin/immudex-secured-firefox +++ b/tools/bin/immudex-secured-firefox @@ -4,18 +4,18 @@ function help() { echo "This tool running up a Firefox browser via firejail with sandboxing "; echo "and forcing network interface to that we use to internet connection."; echo; - echo "Usage: immudex-secured-firefox [--help] [--version]"; + echo "Usage: immudex-secured-firefox [-h] [-v]"; echo; echo "Exaples:"; - echo " immudex-secured-firefox Run secured browser."; - echo " immudex-secured-firefox --help Print this message."; - echo " immudex-secured-firefox --version Print information about version, author and copyrights"; + echo " immudex-secured-firefox Run secured browser."; + echo " immudex-secured-firefox -h Print this message."; + echo " immudex-secured-firefox -v Print information about version, author and copyrights"; echo; echo "Report bugs to "; } function version(){ - echo "immudex-secured-firefox 1.0"; + echo "immudex-secured-firefox 1.1"; echo; echo "Copyright (C) 2026 morketsmerke.org"; echo "This is free software; see the source for copying conditions. There is NO"; @@ -25,10 +25,10 @@ function version(){ } if [ "$1" ]; then - if [ "$1" = "--help" ]; then + if [ "$1" = "-h" ]; then help; exit 0; - elif [ "$1" = "--version" ]; then + elif [ "$1" = "-v" ]; then version; exit 0; fi diff --git a/tools/bin/immudex-secured-librewolf b/tools/bin/immudex-secured-librewolf index 30d65ee..b37b615 100755 --- a/tools/bin/immudex-secured-librewolf +++ b/tools/bin/immudex-secured-librewolf @@ -4,18 +4,18 @@ function help() { echo "immudex-secured-librewolf, support for LibreWolf version. LibreWolf isn't"; echo "part of immudex, but this tool officialy existed as a part of project."; echo; - echo "Usage: immudex-secured-librewolf [--help] [--version]"; + echo "Usage: immudex-secured-librewolf [-h] [-v]"; echo; echo "Examples:"; - echo " immudex-secured-librewolf Run sandboxed LibreWolf browser." - echo " immudex-secured-librewolf --help Print this messages." - echo " immudex-secured-librewolf --version Print information about version, author and copyrights."; + echo " immudex-secured-librewolf Run sandboxed LibreWolf browser." + echo " immudex-secured-librewolf -h Print this messages." + echo " immudex-secured-librewolf -v Print information about version, author and copyrights."; echo; echo "Report bugs to "; } function version(){ - echo "immudex-secured-librewolf 1.0"; + echo "immudex-secured-librewolf 1.1"; echo; echo "Copyright (C) 2026 morketsmerke.org"; echo "This is free software; see the source for copying conditions. There is NO"; @@ -25,10 +25,10 @@ function version(){ } if [ "$1" ]; then - if [ "$1" = "--help" ]; then + if [ "$1" = "-h" ]; then help; exit; - elif [ "$1" = "--version" ]; then + elif [ "$1" = "-v" ]; then version; exit; fi diff --git a/tools/bin/immudex-shoutcasts b/tools/bin/immudex-shoutcasts index 3c33211..0e76b45 100755 --- a/tools/bin/immudex-shoutcasts +++ b/tools/bin/immudex-shoutcasts @@ -13,17 +13,17 @@ function help() { echo "directory and download .m3u file from radio-browser.info based on a space-separated keywords."; echo "Data from radio-browser.info are limited to 30 results."; echo; - echo "Usage: immudex-shoutcasts [--source=icecast | radio] [--help] [--version] --keywords=keyword1...keywordN"; + echo "Usage: immudex-shoutcasts [-s icecast | radio] [-h] [-v] -k keyword1...keywordN"; echo; echo "Options:"; - echo " --source=icecast/radio This parameter specifies source, if we want define a source. It can be omitted, then both sources will be searched."; - echo " --keywords=keyword1...keywordsN This parameter is required, it pass keywords to search. Keywords are space-separated."; - echo " --help Print this message."; - echo " --version Print information about version, author and copyrights."; + echo " -s icecast/radio This parameter specifies source, if we want define a source. It can be omitted, then both sources will be searched."; + echo " -k keyword1...keywordsN This parameter is required, it pass keywords to search. Keywords are space-separated."; + echo " -h Print this message."; + echo " -v Print information about version, author and copyrights."; echo; echo "Examples:"; - echo " immudex-shoutcasts --keywords=Classic Rock Script will be search internet radios and shoutcast for 'Classic Rock' keywords"; - echo " immudex-shoutcasts --source=radio --keywords=lofi Script will be search internet radios (because source is given) for 'lofi' keyword"; + echo " immudex-shoutcasts -k Classic Rock Script will be search internet radios and shoutcast for 'Classic Rock' keywords"; + echo " immudex-shoutcasts -s radio -k lofi Script will be search internet radios (because source is given) for 'lofi' keyword"; echo; echo "Files:" echo " /tmp/icecast.idx Temporary file, store search results from icecast directory for parsing."; @@ -33,7 +33,7 @@ function help() { } function version() { - echo "immudex-shoutcasts 1.0"; + echo "immudex-shoutcasts 1.1"; echo; echo "Copyright (C) 2026 morketsmerke.org"; echo "This is free software; see the source for copying conditions. There is NO"; @@ -102,20 +102,23 @@ function listOfStations() { if [ "$1" ]; then - if [ "$1" ] && [ "$1" = "--help" ]; then + if [ "$1" ] && [ "$1" = "-h" ]; then help; exit 0; - elif [ "$1" ] && [ "$1" = "--version" ]; then + elif [ "$1" ] && [ "$1" = "-v" ]; then version; exit 0; fi - option=$(echo $1 | cut -d '=' -f 1); - if [ "$option" = "--source" ]; then - src=$(echo $1 | cut -d '=' -f 2); - search=$(echo $* | cut -d '=' -f 3-); - elif [ "$option" = "--keywords" ]; then - search=$(echo $* | cut -d "=" -f 2-); + option=$1; + if [ "$option" = "-s" ]; then + shift; + src=$1; + shift 2; + search=$* + elif [ "$option" = "-k" ]; then + shift; + search=$*; fi else help; diff --git a/tools/bin/immudex-version b/tools/bin/immudex-version index 9c663f7..2e7d497 100755 --- a/tools/bin/immudex-version +++ b/tools/bin/immudex-version @@ -3,11 +3,11 @@ function help() { echo "Script returns first 7 signs of immudex commit ID."; echo; - echo "Usage: immudex-version [--help] [--version]"; + echo "Usage: immudex-version [-h] [-v]"; echo; echo "Options:"; - echo " --help Print this message."; - echo " --version Print information about version, author and copyrights."; + echo " -h Print this message."; + echo " -v Print information about version, author and copyrights."; echo; echo "Files:"; echo " /run/live/medium/live/changelog Stores information about currently running immudex image."; @@ -16,7 +16,7 @@ function help() { } function version(){ - echo "immudex-version 1.0"; + echo "immudex-version 1.1"; echo; echo "Copyright (C) 2026 morketsmerke.org"; echo "This is free software; see the source for copying conditions. There is NO"; @@ -26,10 +26,10 @@ function version(){ } if [ "$1" ]; then - if [ "$1" = "--help" ]; then + if [ "$1" = "-h" ]; then help; exit 0; - elif [ "$1" = "--version" ]; then + elif [ "$1" = "-v" ]; then version; exit 0; fi diff --git a/tools/bin/immudex-ytplay b/tools/bin/immudex-ytplay index 4634065..29901e2 100755 --- a/tools/bin/immudex-ytplay +++ b/tools/bin/immudex-ytplay @@ -15,19 +15,19 @@ with possible format are printed. User have to put video and audio quality from table in requested format: videoQualityID+audioQualityID. There are a hint. Script is half-interactive. -Usage: immudex-ytplay [--search='keyword1...keywordN' --video | --audio] [--video youtube_link] [--audio youtube_link] [--help] [--version] +Usage: immudex-ytplay [-a youtube_link] [-h] [-i] [-s 'keyword1...keywordN' -v | -a] [-v youtube_link] Options: - --search='keyword1...keywordN' --video/--audio Search given keywords on YouTube and play video or audiotrack. - --video YouTube_Link Play YouTube video. - --audio YouTube_Link Play only YouTube video audiotrack. - --help Print this message. - --version Print information about version, author and copyrights. + -a YouTube_Link Play only YouTube video audiotrack. + -h Print this message. + -i Print information about version, author and copyrights. + -s 'keyword1...keywordN' -v/-a Search given keywords on YouTube and play video or audiotrack. + -v YouTube_Link Play YouTube video. Examples: - immudex-ytplay --search='lofi' --audio Script will be search a lofi keyword in YouTube and play only audio tracks from choosen video. - immudex-ytplay --video https://youtube.com/watch?v=... Script will be play a video from given link, of course is publicly available. - immudex-ytplay --audio https://youtube.com/watch?v=... Script will be play a audio track from given video link. The principle of video playback also applies here. + immudex-ytplay -s 'lofi' -a Script will be search a lofi keyword in YouTube and play only audio tracks from choosen video. + immudex-ytplay -v https://youtube.com/watch?v=... Script will be play a video from given link, of course is publicly available. + immudex-ytplay -a https://youtube.com/watch?v=... Script will be play a audio track from given video link. The principle of video playback also applies here. Report bugs to ''') @@ -69,10 +69,10 @@ def getFormat(videoID): return f if len(sys.argv) == 2: - if sys.argv[1] == '--help': + if sys.argv[1] == '-h': usage() sys.exit(0) - elif sys.argv[1] == '--version': + elif sys.argv[1] == '-i': version() sys.exit(0) @@ -80,18 +80,18 @@ if len(sys.argv) < 2: usage() sys.exit(2) -option=sys.argv[1].split("=", 1)[0] +option=sys.argv[1] -if option == '--search': +if option == '-s': if len(sys.argv) > 2: - if sys.argv[2] == '--video': + if sys.argv[2] == '-v': mode = "video" - elif sys.argv[2] == '--audio': + elif sys.argv[2] == '-a': mode = "audio" else: usage() sys.exit(2) - keywords = sys.argv[1].split("=", 1)[1] + keywords = sys.argv[1] video = ytSearch(keywords) subprocess.run('clear') @@ -111,7 +111,7 @@ if option == '--search': usage() sys.exit(2) -elif sys.argv[1] == '--audio': +elif sys.argv[1] == '-a': if len(sys.argv) > 2: link=sys.argv[2] ytFormat="--no-video" @@ -120,7 +120,7 @@ elif sys.argv[1] == '--audio': usage() sys.exit(2) -elif sys.argv[1] == '--video': +elif sys.argv[1] == '-v': if len(sys.argv) > 2: link=sys.argv[2] videoID=link[-11:] diff --git a/immudex-complete-project/complete/immudex-branch b/tools/completions/immudex-branch similarity index 100% rename from immudex-complete-project/complete/immudex-branch rename to tools/completions/immudex-branch diff --git a/tools/completions/immudex-cdrip b/tools/completions/immudex-cdrip new file mode 100644 index 0000000..811bf6d --- /dev/null +++ b/tools/completions/immudex-cdrip @@ -0,0 +1,17 @@ +# immudex-cdrip completion -*- shell-script -*- +idx_cdrip_complete() { + local cur; + + COMPREPLY=() + cur=${COMP_WORDS[COMP_CWORD]}; + + if [ $COMP_CWORD -eq 1 ]; then + COMPREPLY=( $(compgen -W '-g -h -o -r -v' -- $cur) ); + elif [ $COMP_CWORD -eq 2 ]; then + return 0; + fi + return 0; +} && + complete -F idx_cdrip_complete immudex-cdrip + +# ex: filetype=sh diff --git a/tools/completions/immudex-create-media b/tools/completions/immudex-create-media new file mode 100644 index 0000000..5e7be89 --- /dev/null +++ b/tools/completions/immudex-create-media @@ -0,0 +1,38 @@ +# immudex-create-media completion -*- shell-script -*- + +disk_list() { + i=0; + diskList=(); + for disk in $(ls -l /dev/ | grep 'disk' | grep '\ 0\ ' | awk '{printf $NF" "}'); do + diskList[$i]="/dev/${disk}"; + i=$(expr $i + 1); + done + echo -n ${diskList[@]}; +} + +idx_create_media_complete() { + local cur prev + + COMPREPLY=() + cur=${COMP_WORDS[COMP_CWORD]}; + prev=${COMP_WORDS[COMP_CWORD-1]}; + + if [ $COMP_CWORD -eq 1 ]; then + COMPREPLY=( $(compgen -W '-e32 -h -l -n -v' -- $cur) ); + elif [ $COMP_CWORD -eq 2 ]; then + case "$prev" in + '-e32' | '-l') COMPREPLY=( $(compgen -f -X "!*.iso" -- $cur) );; + '-n') COMPREPLY=( $(compgen -W "$(disk_list)" -- $cur) );; + *) return 0;; + esac + elif [ $COMP_CWORD -eq 3 ]; then + case "$prev" in + *.iso) COMPREPLY=( $(compgen -W "$(disk_list)" -- $cur) );; + *) return 0;; + esac + fi + return 0 +} && + complete -F idx_create_media_complete immudex-create-media + +# ex: filetype=sh diff --git a/tools/completions/immudex-crypt b/tools/completions/immudex-crypt new file mode 100644 index 0000000..a4f5de9 --- /dev/null +++ b/tools/completions/immudex-crypt @@ -0,0 +1,42 @@ +# immudex-crypt completion -*- shell-script -*- + +return_ic_index() { + echo -n "$(ls /dev/mapper | grep 'immudex-crypt[0-9]*' | grep -o '[0-9]*' | awk '{printf $1" " }')"; +} + +part_list() { + i=0; + partList=(); + for part in $(ls -l /dev/ | grep '^b' | grep -v '\ 0\ ' | grep -v 'dm' | awk '{printf $NF" "}'); do + partList[$i]="/dev/${part}"; + i=$(expr $i + 1); + done + echo -n ${partList[@]}; +} + +cryptDevice_list() { + echo -n "$(/usr/sbin/blkid | grep 'crypto_LUKS' | awk '{printf $1" "}' | sed 's/://g')"; +} + +idx_crypt_complete() { + local cur prev + + COMPREPLY=() + cur=${COMP_WORDS[COMP_CWORD]}; + prev=${COMP_WORDS[COMP_CWORD-1]} + + if [ $COMP_CWORD -eq 1 ]; then + COMPREPLY=( $(compgen -W '-c -f -h -l -o -v' -- $cur) ); + elif [ $COMP_CWORD -eq 2 ]; then + case "$prev" in + '-c') COMPREPLY=( $(compgen -W "$(return_ic_index)" -- $cur) );; + '-f') COMPREPLY=( $(compgen -W "$(part_list)" -- $cur) );; + '-o') COMPREPLY=( $(compgen -W "$(cryptDevice_list)" -- $cur) );; + *) return 0;; + esac + fi + return 0; +} && + complete -F idx_crypt_complete immudex-crypt + +# ex: filetype=sh diff --git a/tools/completions/immudex-hostname b/tools/completions/immudex-hostname new file mode 100644 index 0000000..7cedad2 --- /dev/null +++ b/tools/completions/immudex-hostname @@ -0,0 +1,19 @@ +# immudex-hostname completion -*- shell-script -*- + +idx_simple_options_complete() +{ + local cur; + + COMPREPLY=(); + cur=${COMP_WORDS[COMP_CWORD]}; + + if [ $COMP_CWORD -eq 1 ]; then + COMPREPLY=( $(compgen -W '-h -v' -- $cur) ); + elif [ $COMP_CWORD -eq 2 ]; then + return 0; + fi + return 0; +} && + complete -F idx_simple_options_complete immudex-hostname + +# ex: filetype=sh diff --git a/tools/completions/immudex-import-gpgkeys b/tools/completions/immudex-import-gpgkeys new file mode 100644 index 0000000..36382a6 --- /dev/null +++ b/tools/completions/immudex-import-gpgkeys @@ -0,0 +1,19 @@ +# immudex-import-gpgkeys completion -*- shell-script -*- + +idx_simple_options_complete() +{ + local cur; + + COMPREPLY=(); + cur=${COMP_WORDS[COMP_CWORD]}; + + if [ $COMP_CWORD -eq 1 ]; then + COMPREPLY=( $(compgen -W '-h -v' -- $cur) ); + elif [ $COMP_CWORD -eq 2 ]; then + return 0; + fi + return 0; +} && + complete -F idx_simple_options_complete immudex-import-gpgkeys + +# ex: filetype=sh diff --git a/tools/completions/immudex-import-sshkeys b/tools/completions/immudex-import-sshkeys new file mode 100644 index 0000000..4d11be0 --- /dev/null +++ b/tools/completions/immudex-import-sshkeys @@ -0,0 +1,18 @@ +# immudex-import-sshkeys completion -*- shell-script -*- +idx_import_sshkeys_complete() { + local cur; + + COMPREPLY=(); + cur=${COMP_WORDS[COMP_CWORD]}; + + if [ $COMP_CWORD -eq 1 ]; then + COMPREPLY=( $(compgen -W '-i -h -v' -- $cur) ); + elif [ $COMP_CWORD -eq 2 ]; then + return 0; + fi + return 0; + +} && + complete -F idx_import_sshkeys_complete immudex-import-sshkeys + +# ex: filetype=sh diff --git a/tools/completions/immudex-install b/tools/completions/immudex-install new file mode 100644 index 0000000..dc8769c --- /dev/null +++ b/tools/completions/immudex-install @@ -0,0 +1,18 @@ +# immudex-install completion -*- shell-script -*- +idx_install_complete() { + local cur; + + COMPREPLY=(); + cur=${COMP_WORDS[COMP_CWORD]}; + + if [ $COMP_CWORD -eq 1 ]; then + COMPREPLY=( $(compgen -W '-h -p -v' -- $cur) ); + elif [ $COMP_CWORD -eq 2 ]; then + return 0; + fi + return 0; + +} && + complete -F idx_install_complete immudex-install + +# ex: filetype=sh diff --git a/tools/completions/immudex-meteo b/tools/completions/immudex-meteo new file mode 100644 index 0000000..9f85a96 --- /dev/null +++ b/tools/completions/immudex-meteo @@ -0,0 +1,29 @@ +# immudex-meteo completion -*- shell-script -*- + +idx_meteo_complete() { +local cur prev + + COMPREPLY=() + cur=${COMP_WORDS[COMP_CWORD]}; + prev=${COMP_WORDS[COMP_CWORD-1]} + + if [ $COMP_CWORD -eq 1 ]; then + COMPREPLY=( $(compgen -W '-h -l -m -s -v' -- $cur) ); + elif [ $COMP_CWORD -eq 2 ]; then + case "$prev" in + '-l'|'-m'|'-s') + if [ -f /etc/motd.conf ]; then + source /etc/motd.conf; + COMPREPLY=( $(compgen -W "$LOCATION" -- $cur) ) + else + return 0; + fi + ;; + *) return 0;; + esac + fi + return 0; +} && + complete -F idx_meteo_complete immudex-meteo + +# ex: filetype=sh diff --git a/tools/completions/immudex-morketsmerke b/tools/completions/immudex-morketsmerke new file mode 100644 index 0000000..76fcb29 --- /dev/null +++ b/tools/completions/immudex-morketsmerke @@ -0,0 +1,19 @@ +# immudex-morketsmerke completion -*- shell-script -*- + +idx_morketsmerke_complete() { + local cur; + + COMPREPLY=(); + cur=${COMP_WORDS[COMP_CWORD]}; + + if [ $COMP_CWORD -eq 1 ]; then + COMPREPLY=( $(compgen -W '-b -h -v' -- $cur) ); + elif [ $COMP_CWORD -eq 2 ]; then + return 0; + fi + return 0; + +} && + complete -F idx_morketsmerke_complete immudex-morketsmerke + +# ex: filetype=sh diff --git a/tools/completions/immudex-motd b/tools/completions/immudex-motd new file mode 100644 index 0000000..f7d31e0 --- /dev/null +++ b/tools/completions/immudex-motd @@ -0,0 +1,19 @@ +# immudex-motd completion -*- shell-script -*- + +idx_simple_options_complete() +{ + local cur; + + COMPREPLY=(); + cur=${COMP_WORDS[COMP_CWORD]}; + + if [ $COMP_CWORD -eq 1 ]; then + COMPREPLY=( $(compgen -W '-h -v' -- $cur) ); + elif [ $COMP_CWORD -eq 2 ]; then + return 0; + fi + return 0; +} && + complete -F idx_simple_options_complete immudex-motd + +# ex: filetype=sh diff --git a/tools/completions/immudex-padlock b/tools/completions/immudex-padlock new file mode 100644 index 0000000..0b1b402 --- /dev/null +++ b/tools/completions/immudex-padlock @@ -0,0 +1,19 @@ +# immudex-padlock completion -*- shell-script -*- + +idx_simple_options_complete() +{ + local cur; + + COMPREPLY=(); + cur=${COMP_WORDS[COMP_CWORD]}; + + if [ $COMP_CWORD -eq 1 ]; then + COMPREPLY=( $(compgen -W '-h -v' -- $cur) ); + elif [ $COMP_CWORD -eq 2 ]; then + return 0; + fi + return 0; +} && + complete -F idx_simple_options_complete immudex-padlock + +# ex: filetype=sh diff --git a/tools/completions/immudex-pl b/tools/completions/immudex-pl new file mode 100644 index 0000000..899c95c --- /dev/null +++ b/tools/completions/immudex-pl @@ -0,0 +1,18 @@ +# immudex-pl completion -*- shell-script -*- +idx_pl_complete() { + local cur; + + COMPREPLY=(); + cur=${COMP_WORDS[COMP_CWORD]}; + + if [ $COMP_CWORD -eq 1 ]; then + COMPREPLY=( $(compgen -W '-h -i -v' -- $cur) ); + elif [ $COMP_CWORD -eq 2 ]; then + return 0; + fi + return 0; + +} && + complete -F idx_pl_complete immudex-pl + +# ex: filetype=sh diff --git a/tools/completions/immudex-run b/tools/completions/immudex-run new file mode 100644 index 0000000..5b18a05 --- /dev/null +++ b/tools/completions/immudex-run @@ -0,0 +1,19 @@ +# immudex-run completion -*- shell-script -*- + +idx_simple_options_complete() +{ + local cur; + + COMPREPLY=(); + cur=${COMP_WORDS[COMP_CWORD]}; + + if [ $COMP_CWORD -eq 1 ]; then + COMPREPLY=( $(compgen -W '-h -v' -- $cur) ); + elif [ $COMP_CWORD -eq 2 ]; then + return 0; + fi + return 0; +} && + complete -F idx_simple_options_complete immudex-run + +# ex: filetype=sh diff --git a/tools/completions/immudex-secured-firefox b/tools/completions/immudex-secured-firefox new file mode 100644 index 0000000..11beb37 --- /dev/null +++ b/tools/completions/immudex-secured-firefox @@ -0,0 +1,19 @@ +# immudex-secured-firefox completion -*- shell-script -*- + +idx_simple_options_complete() +{ + local cur; + + COMPREPLY=(); + cur=${COMP_WORDS[COMP_CWORD]}; + + if [ $COMP_CWORD -eq 1 ]; then + COMPREPLY=( $(compgen -W '-h -v' -- $cur) ); + elif [ $COMP_CWORD -eq 2 ]; then + return 0; + fi + return 0; +} && + complete -F idx_simple_options_complete immudex-secured-firefox + +# ex: filetype=sh diff --git a/tools/completions/immudex-secured-librewolf b/tools/completions/immudex-secured-librewolf new file mode 100644 index 0000000..74ee4b1 --- /dev/null +++ b/tools/completions/immudex-secured-librewolf @@ -0,0 +1,19 @@ +# immudex-secured-librewolf completion -*- shell-script -*- + +idx_simple_options_complete() +{ + local cur; + + COMPREPLY=(); + cur=${COMP_WORDS[COMP_CWORD]}; + + if [ $COMP_CWORD -eq 1 ]; then + COMPREPLY=( $(compgen -W '-h -v' -- $cur) ); + elif [ $COMP_CWORD -eq 2 ]; then + return 0; + fi + return 0; +} && + complete -F idx_simple_options_complete immudex-secured-librewolf + +# ex: filetype=sh diff --git a/tools/completions/immudex-shoutcasts b/tools/completions/immudex-shoutcasts new file mode 100644 index 0000000..67b11cf --- /dev/null +++ b/tools/completions/immudex-shoutcasts @@ -0,0 +1,23 @@ +# immudex-shoutcasts completion -*- shell-script -*- +idx_shoutcasts_complete() { + local cur prev + + COMPREPLY=() + cur=${COMP_WORDS[COMP_CWORD]}; + prev=${COMP_WORDS[COMP_CWORD-1]} + + if [ $COMP_CWORD -eq 1 ]; then + COMPREPLY=( $(compgen -W '-s -k -h -v' -- $cur) ); + elif [ $COMP_CWORD -eq 2 ]; then + case "$prev" in + '-s') + COMPREPLY=( $(compgen -W "icecast radio" -- $cur) ) + ;; + *) return 0;; + esac + fi + return 0; +} && + complete -F idx_shoutcasts_complete immudex-shoutcasts + +# ex: filetype=sh diff --git a/tools/completions/immudex-upgrade b/tools/completions/immudex-upgrade new file mode 100644 index 0000000..4814015 --- /dev/null +++ b/tools/completions/immudex-upgrade @@ -0,0 +1,18 @@ +# immudex-upgrade completion -*- shell-script -*- +idx_upgrade_complete() { + local cur; + + COMPREPLY=(); + cur=${COMP_WORDS[COMP_CWORD]}; + + if [ $COMP_CWORD -eq 1 ]; then + COMPREPLY=( $(compgen -W '-c -d -h -m -p -s -u -v' -- $cur) ); + elif [ $COMP_CWORD -eq 2 ]; then + return 0; + fi + return 0; + +} && + complete -F idx_simple_options_complete immudex-branch + +# ex: filetype=sh diff --git a/tools/completions/immudex-version b/tools/completions/immudex-version new file mode 100644 index 0000000..a7ed4b7 --- /dev/null +++ b/tools/completions/immudex-version @@ -0,0 +1,19 @@ +# immudex-version completion -*- shell-script -*- + +idx_simple_options_complete() +{ + local cur; + + COMPREPLY=(); + cur=${COMP_WORDS[COMP_CWORD]}; + + if [ $COMP_CWORD -eq 1 ]; then + COMPREPLY=( $(compgen -W '-h -v' -- $cur) ); + elif [ $COMP_CWORD -eq 2 ]; then + return 0; + fi + return 0; +} && + complete -F idx_simple_options_complete immudex-version + +# ex: filetype=sh diff --git a/tools/completions/immudex-ytplay b/tools/completions/immudex-ytplay new file mode 100644 index 0000000..3da1563 --- /dev/null +++ b/tools/completions/immudex-ytplay @@ -0,0 +1,22 @@ +# immudex-ytplay completion -*- shell-script -*- + +idx_ytplay_complete() { + local cur; + + COMPREPLY=(); + cur=${COMP_WORDS[COMP_CWORD]}; + prev=${COMP_WORDS[COMP_CWORD-2]}; + + if [ $COMP_CWORD -eq 1 ]; then + COMPREPLY=( $(compgen -W '-a -h -i -s -v' -- $cur) ); + elif [ $COMP_CWORD -eq 3 ]; then + case "$prev" in + '-s') COMPREPLY=( $(compgen -W '-a -v' -- $cur) );; + *) return 0;; + esac + fi + return 0; +} && + complete -F idx_ytplay_complete immudex-ytplay + +# ex: filetype=sh diff --git a/tools/man/immudex-branch.1.gz b/tools/man/immudex-branch.1.gz index 57ac8d4..9ef8180 100644 Binary files a/tools/man/immudex-branch.1.gz and b/tools/man/immudex-branch.1.gz differ diff --git a/tools/man/immudex-cdrip.1.gz b/tools/man/immudex-cdrip.1.gz index cd271c6..5a16bb8 100644 Binary files a/tools/man/immudex-cdrip.1.gz and b/tools/man/immudex-cdrip.1.gz differ diff --git a/tools/man/immudex-create-media.1.gz b/tools/man/immudex-create-media.1.gz index 6f2a0eb..6e379bb 100644 Binary files a/tools/man/immudex-create-media.1.gz and b/tools/man/immudex-create-media.1.gz differ diff --git a/tools/man/immudex-crypt.1.gz b/tools/man/immudex-crypt.1.gz index 74e1112..1340bbb 100644 Binary files a/tools/man/immudex-crypt.1.gz and b/tools/man/immudex-crypt.1.gz differ diff --git a/tools/man/immudex-hostname.1.gz b/tools/man/immudex-hostname.1.gz index e723605..7553472 100644 Binary files a/tools/man/immudex-hostname.1.gz and b/tools/man/immudex-hostname.1.gz differ diff --git a/tools/man/immudex-import-gpgkeys.1.gz b/tools/man/immudex-import-gpgkeys.1.gz index b1178fa..5539a11 100644 Binary files a/tools/man/immudex-import-gpgkeys.1.gz and b/tools/man/immudex-import-gpgkeys.1.gz differ diff --git a/tools/man/immudex-import-sshkeys.1.gz b/tools/man/immudex-import-sshkeys.1.gz index f0f4f58..4d0ba56 100644 Binary files a/tools/man/immudex-import-sshkeys.1.gz and b/tools/man/immudex-import-sshkeys.1.gz differ diff --git a/tools/man/immudex-install.1.gz b/tools/man/immudex-install.1.gz index 960837c..f1b4628 100644 Binary files a/tools/man/immudex-install.1.gz and b/tools/man/immudex-install.1.gz differ diff --git a/tools/man/immudex-meteo.1.gz b/tools/man/immudex-meteo.1.gz index ff80026..f7657a2 100644 Binary files a/tools/man/immudex-meteo.1.gz and b/tools/man/immudex-meteo.1.gz differ diff --git a/immudex-complete-project/immudex-morketsmerke.1.gz b/tools/man/immudex-morketsmerke.1.gz similarity index 100% rename from immudex-complete-project/immudex-morketsmerke.1.gz rename to tools/man/immudex-morketsmerke.1.gz diff --git a/tools/man/immudex-motd.1.gz b/tools/man/immudex-motd.1.gz index d10fa8b..3933c5a 100644 Binary files a/tools/man/immudex-motd.1.gz and b/tools/man/immudex-motd.1.gz differ diff --git a/tools/man/immudex-padlock.1.gz b/tools/man/immudex-padlock.1.gz index 9b3fd03..6edbf60 100644 Binary files a/tools/man/immudex-padlock.1.gz and b/tools/man/immudex-padlock.1.gz differ diff --git a/tools/man/immudex-pl.1.gz b/tools/man/immudex-pl.1.gz index e75ec4a..19c6833 100644 Binary files a/tools/man/immudex-pl.1.gz and b/tools/man/immudex-pl.1.gz differ diff --git a/tools/man/immudex-run.1.gz b/tools/man/immudex-run.1.gz index 3cab805..252ef0c 100644 Binary files a/tools/man/immudex-run.1.gz and b/tools/man/immudex-run.1.gz differ diff --git a/tools/man/immudex-secured-firefox.1.gz b/tools/man/immudex-secured-firefox.1.gz index b12f971..9a78d6a 100644 Binary files a/tools/man/immudex-secured-firefox.1.gz and b/tools/man/immudex-secured-firefox.1.gz differ diff --git a/tools/man/immudex-secured-librewolf.1.gz b/tools/man/immudex-secured-librewolf.1.gz index f910dba..7dc236c 100644 Binary files a/tools/man/immudex-secured-librewolf.1.gz and b/tools/man/immudex-secured-librewolf.1.gz differ diff --git a/tools/man/immudex-shoutcasts.1.gz b/tools/man/immudex-shoutcasts.1.gz index 4f790bb..7696ca5 100644 Binary files a/tools/man/immudex-shoutcasts.1.gz and b/tools/man/immudex-shoutcasts.1.gz differ diff --git a/tools/man/immudex-upgrade.1.gz b/tools/man/immudex-upgrade.1.gz index 6412f4a..1ed7348 100644 Binary files a/tools/man/immudex-upgrade.1.gz and b/tools/man/immudex-upgrade.1.gz differ diff --git a/tools/man/immudex-version.1.gz b/tools/man/immudex-version.1.gz index f3e0039..281a77a 100644 Binary files a/tools/man/immudex-version.1.gz and b/tools/man/immudex-version.1.gz differ diff --git a/tools/man/immudex-ytplay.1.gz b/tools/man/immudex-ytplay.1.gz index d4c93f1..edbdfa1 100644 Binary files a/tools/man/immudex-ytplay.1.gz and b/tools/man/immudex-ytplay.1.gz differ diff --git a/tools/sbin/immudex-create-media b/tools/sbin/immudex-create-media index 1441f9d..c9bd76d 100755 --- a/tools/sbin/immudex-create-media +++ b/tools/sbin/immudex-create-media @@ -10,27 +10,26 @@ function help() { echo "script prepare usb disks for 32-bit EFI systems." echo "Superuser (root) privileges are required."; echo; - echo "Usage: immudex-create-media [--help] [--version] [--i386-efi --disk=usb_disk --isofile=immudex.iso] [--nuke --disk=usb_disk] --disk=usb_disk --isofile=file.iso"; + echo "Usage: immudex-create-media [-e32 immudex.iso /dev/sdX] [-h] [-l file.iso /dev/sdX] [-n /dev/sdX] [-v]"; echo; echo "Options:"; - echo " --disk=/dev/sdX Indicates disk device."; - echo " --isofile=file.iso Indicates iso file."; - echo " --i386-efi --disk=/dev/sdX immudex.iso Creating 32-bit EFI bootable usb drive with iso image. (Compatibile with immudex images only.)"; - echo " --nuke --disk=/dev/sdX Write 0's to 1st megabyte of disk, wiping partition table."; - echo " --help Print this message."; - echo " --version Print information about version, author and copyrights."; + echo " -e32 immudex.iso /dev/sdX Creating 32-bit EFI bootable usb drive with iso image. (Compatibile with immudex images only.)"; + echo " --help Print this message."; + echo " -l file.iso /dev/sdX Load file.iso to /dev/sdX drive."; + echo " -n /dev/sdX Write 0's to 1st megabyte of disk, wiping partition table."; + echo " -v Print information about version, author and copyrights."; echo; echo "Exmaples:"; - echo " immudex-create-media Print this message."; - echo " immudex-create-media --disk=/dev/sdX --isofile=file.iso Writes iso file to usb stick, made it bootable."; - echo " immudex-create-media --i386-efi --disk=/dev/sdX --isofile=immudex.iso Create 32-bit EFI bootable usb stick with immudex."; - echo " immudex-create-media --nuke --disk=/dev/sdX Writes first MB with 0's, deleting partition table"; + echo " immudex-create-media Print this message."; + echo " immudex-create-media -l /dev/sdX file.iso Writes iso file to usb stick, made it bootable."; + echo " immudex-create-media -e32 /dev/sdX immudex.iso Create 32-bit EFI bootable usb stick with immudex."; + echo " immudex-create-media -n /dev/sdX Writes first MB with 0's, deleting partition table"; echo; echo "Report bugs to "; } function version() { - echo "immudex-create-media 1.0"; + echo "immudex-create-media 1.1"; echo; echo "Copyright (C) 2026 morketsmerke.org"; echo "This is free software; see the source for copying conditions. There is NO"; @@ -45,25 +44,21 @@ if [ $UID -ne 0 ]; then exit 1; fi -if [ "$1" ] && [ "$1" = "--help" ]; then help; exit 0; fi -if [ "$1" ] && [ "$1" = "--version" ]; then version; exit 0; fi +if [ "$1" ] && [ "$1" = "-h" ]; then help; exit 0; fi +if [ "$1" ] && [ "$1" = "-v" ]; then version; exit 0; fi -if [ "$1" ] && [ "$1" = "--i386-efi" ]; then target="i386-efi"; shift; fi -if [ "$1" ] && [ "$1" = "--nuke" ]; then target="nuke"; shift; fi -if [ "$1" ] && [ "$(echo $1 | cut -d "=" -f 1)" = "--disk" ]; then - disk=$(echo $1 | cut -d "=" -f 2); shift; +if [ "$1" ] && [ "$1" = "-e32" ]; then target="i386-efi"; shift; fi +if [ "$1" ] && [ "$1" = "-n" ]; then target="nuke"; shift; fi +if [ "$1" ] && [ "$1" = "-l" ]; then target="load"; shift; fi +if [ "$1" ] && $(echo $1 | grep -q '\.iso'); then + iso=$1; shift; +fi +if [ "$1" ] && $(echo $1 | grep -q '/dev/'); then + disk=$1; shift; else help; exit 1; fi -if [ ! "$target" ] || [ "$target" != "nuke" ]; then - if [ "$1" ] && [ "$(echo $1 | cut -d "=" -f 1)" = "--isofile" ]; then - iso=$(echo $1 | cut -d "=" -f 2); - else - help; - exit 1; - fi -fi if [ "$target" = "i386-efi" ]; then echo -n "Writing zeros to 1st megabyte on disk..."; @@ -126,7 +121,7 @@ elif [ "$target" = "nuke" ]; then dd if=/dev/zero bs=1M of=$disk count=1 > /dev/null 2>&1; if [ $? -eq 0 ]; then echo -e "[${GREEN}OK${ENDCOLOR}]"; fi -else +elif [ "$target" = "load" ]; then echo -n "Writing zeros to 1st megabyte on disk..."; dd if=/dev/zero bs=1M of=$disk count=1 > /dev/null 2>&1; if [ $? -eq 0 ]; then echo -e "[${GREEN}OK${ENDCOLOR}]"; fi @@ -134,4 +129,7 @@ else echo -n "Writing iso image to the disk..." dd if=$iso bs=1M of=$disk > /dev/null 2>&1; if [ $? -eq 0 ]; then echo -e "[${GREEN}OK${ENDCOLOR}]"; fi +else + help; + exit 1; fi diff --git a/tools/sbin/immudex-crypt b/tools/sbin/immudex-crypt index 38fd47c..fdc6875 100755 --- a/tools/sbin/immudex-crypt +++ b/tools/sbin/immudex-crypt @@ -8,27 +8,27 @@ function help() { echo "opened device will have index equal 0, second = 1, and so on and on."; echo "Superuser (root) privileges are required."; echo; - echo "Usage: immudex-crypt [--list] [--create=/dev/partition] [--open=crypt_LUKS_device] [--close=index] [--help] [--version]"; + echo "Usage: immudex-crypt [-c index] [-f /dev/partition] [-h] [-l] [-o /dev/crypt_LUKS_device] [-v]"; echo; echo "Options:"; - echo " --list Prints list of opened and available crypt_LUKS devices."; - echo " --create=/dev/partition Preparing device for crypt_LUKS."; - echo " --open=/dev/crypt_LUKS_device Opening and mount crypt_LUKS device (create mount point, if not exist)."; - echo " --close=index Unmounting and close opened crypt_LUKS devices."; - echo " --help Prints this message."; - echo " --version Print information about version, author and copyrights."; + echo " -c INDEX/icINDEX/immudex-cryptINDEX Unmounting and close opened crypt_LUKS devices."; + echo " -f /dev/partition Preparing device for crypt_LUKS."; + echo " -h Prints this message."; + echo " -l Prints list of opened and available crypt_LUKS devices."; + echo " -o /dev/crypt_LUKS_device Opening and mount crypt_LUKS device (it creates mount point, if not exist)."; + echo " -v Print information about version, author and copyrights."; echo; echo "Examples:"; - echo " immudex-crypt --list List available crypt_LUKS devices in the system."; - echo " immudex-crypt --create=/dev/sdX Create crypt_LUKS device from given partition."; - echo " immudex-crypt --open=/dev/sdX Open given crypt_LUKS device (with mounting file system, of course)."; - echo " immudex-crypt --close=0 Close first opened crypt_LUKS device in the system."; + echo " immudex-crypt -l List available crypt_LUKS devices in the system."; + echo " immudex-crypt -f /dev/sdX Create crypt_LUKS device from given partition."; + echo " immudex-crypt -o /dev/sdX Open given crypt_LUKS device (with mounting file system, of course)."; + echo " immudex-crypt -c 0 Close first opened crypt_LUKS device in the system."; echo; echo "Report bugs to "; } function version() { - echo "immudex-crypt 1.0"; + echo "immudex-crypt 1.1"; echo; echo "Copyright (C) 2026 morketsmerke.org"; echo "This is free software; see the source for copying conditions. There is NO"; @@ -176,25 +176,25 @@ if [ "$1" ]; then export USER=$(grep "$RUID" /etc/passwd | cut -d ":" -f1); fi - option=$(echo $1 | cut -d '=' -f 1); - value=$(echo $1 | cut -d '=' -f 2-); + option=$1; + value=$2; case $option in - "--list") list;; - "--open") if [ "$value" ]; then open $value; + "-l") list;; + "-o") if [ "$value" ]; then open $value; else help; exit 1; fi;; - "--close") if [ "$value" ]; then close $value; + "-c") if [ "$value" ]; then close $value; else help; exit 1; fi;; - "--create") if [ "$value" ]; then + "-f") if [ "$value" ]; then create $value; open $value; set_ownership $value; else help; exit 1; fi;; - "--help") help; exit 0;; - "--version") version; exit 0;; + "-h") help; exit 0;; + "-v") version; exit 0;; *) help;; esac else diff --git a/tools/sbin/immudex-hostname b/tools/sbin/immudex-hostname index 0788fc7..5f0af48 100755 --- a/tools/sbin/immudex-hostname +++ b/tools/sbin/immudex-hostname @@ -5,16 +5,16 @@ function help() { echo "service. The script job is to change set appropriate name for this"; echo "host based on computer chassis and 7 last chars from boot ID." echo; - echo "Usage: immudex-hostname [--help] [--version]"; + echo "Usage: immudex-hostname [-h] [-v]"; echo; echo "Options:"; - echo " --help Print this message."; - echo " --version Print information about version, author and copyrights." + echo " -h Print this message."; + echo " -v Print information about version, author and copyrights." echo; echo "Examples:"; - echo " immudex-hostname Set apropriate hostname, usually executed by systemd."; - echo " immudex-hostname --help Print this message."; - echo " immudex-hostname --version Print information about version, author and copyrights."; + echo " immudex-hostname Set apropriate hostname, usually executed by systemd."; + echo " immudex-hostname -h Print this message."; + echo " immudex-hostname -v Print information about version, author and copyrights."; echo; echo "Files:"; echo " /usr/lib/systemd/system/immudex-hostname.service Systemd unit file, to run immudex-hostname script as a service."; @@ -23,7 +23,7 @@ function help() { } function version() { - echo "immudex-hostname 1.0"; + echo "immudex-hostname 1.1"; echo; echo "Copyright (C) 2026 morketsmerke.org"; echo "This is free software; see the source for copying conditions. There is NO"; @@ -34,9 +34,9 @@ function version() { } if [ "$1" ]; then - if [ "$1" = "--help" ]; then + if [ "$1" = "-h" ]; then help; - elif [ "$1" = "--version" ]; then + elif [ "$1" = "-v" ]; then version; fi else diff --git a/tools/sbin/immudex-install b/tools/sbin/immudex-install index 4e2eb69..18139c1 100755 --- a/tools/sbin/immudex-install +++ b/tools/sbin/immudex-install @@ -17,18 +17,18 @@ function help() { echo "changed via below described option."; echo "This script requires superuser (root) privileges."; echo; - echo "Usage: immudex-install [--partition-size=3G] [--help] [--version]"; + echo "Usage: immudex-install [-h] [-p 3G] [-v]"; echo; echo "Options:"; - echo " --partition-size=3G This option change a partition size with immudex image. Usefull for custom builds. By default it's 3GB."; - echo " --help Print this message."; - echo " --version Print information about version, author and copyrights."; + echo " -h Print this message."; + echo " -p 3G This option change a partition size with immudex image. Usefull for custom builds. By default it's 3GB."; + echo " -v Print information about version, author and copyrights."; echo; echo "Examples:"; - echo " immudex-install Standard execution, instalation immudex LiveCD on computer hard disk."; - echo " immudex-install --partition-size=6G Run install script for custom immudex image build."; - echo " immudex-install --help Print this message."; - echo " immudex-install --version Print information about version, author and copyrights."; + echo " immudex-install Standard execution, instalation immudex LiveCD on computer hard disk."; + echo " immudex-install -p 6G Run install script for custom immudex image build."; + echo " immudex-install -h Print this message."; + echo " immudex-install -v Print information about version, author and copyrights."; echo; echo "Report bugs to "; } @@ -45,15 +45,21 @@ function version() { } if [ "$1" ]; then - if [ "$1" = "--help" ]; then + if [ "$1" = "-h" ]; then help; - elif [ "$1" = "--version" ]; then + exit 0; + elif [ "$1" = "-v" ]; then version; + exit 0; fi fi if [ "$1" ]; then - if $(echo $1 | grep -q 'partition-size'); then - idxPartSize=$(echo $1 | cut -d "=" -f2); + if $(echo $1 | grep -q '-p'); then + if [ "$2" ]; then + idxPartSize=$2; + else + idxPartSize="3G"; + fi else idxPartSize="3G"; fi @@ -61,10 +67,10 @@ else idxPartSize="3G"; fi -if [ $UID -ne 0 ]; then - echo "Permission denied!"; - exit 1; -fi +#if [ $UID -ne 0 ]; then +# echo "Permission denied!"; +# exit 1; +#fi while [ true ]; do echo -e "${RED}This script will install immudex on first disk on your machine.${ENDCOLOR}"; diff --git a/tools/sbin/immudex-upgrade b/tools/sbin/immudex-upgrade index b9a849d..b27dfa3 100755 --- a/tools/sbin/immudex-upgrade +++ b/tools/sbin/immudex-upgrade @@ -14,22 +14,23 @@ function help() { echo "Script for searching upgrades and upgrade immudex."; echo "Superuser (root) privileges are required."; echo; - echo "Usage: immudex-upgrade [--help] [--version] [--check] [--upgrade] [--myversion] [--compilation-date] [--packages-upgradable [--security]]"; + echo "Usage: immudex-upgrade [-c] [-d] [-h] [-m] [-p] [-s] [-u] [-v]"; echo; echo "Options:"; - echo " --check Check there are upgrades for immudex"; - echo " --upgrade Upgrade immudex from given source"; - echo " --myversion Prints image details"; - echo " --compilation-date Prints date of image creation"; - echo " --packages-upgradable [--security] Updates apt (packages) list and prints available to upgrade packages, with --security modificator prints only pacakages from security repository branch"; - echo " --help Prints this message."; - echo " --version Prints information about version, author and copyrights."; + echo " -c Check there are upgrades for immudex"; + echo " -d Prints date of image creation"; + echo " -h Prints this message."; + echo " -m Prints image details"; + echo " -p Updates apt (packages) list and prints available to upgrade packages."; + echo " -s Updates apt (packages) list and prints only packages upgrades from security repository branch"; + echo " -u Upgrade immudex from given source"; + echo " -v Prints information about version, author and copyrights."; echo; echo "Report bugs to "; } function version(){ - echo "immudex-upgrade 1.0"; + echo "immudex-upgrade 1.1"; echo; echo "Copyright (C) 2026 morketsmerke.org"; echo "This is free software; see the source for copying conditions. There is NO"; @@ -45,14 +46,14 @@ if [ $UID -ne 0 ]; then fi if [ "$1" ]; then - if [ "$1" = "--help" ]; then + if [ "$1" = "-h" ]; then help; exit 0; - elif [ "$1" = "--version" ]; then + elif [ "$1" = "-v" ]; then version; exit 0; fi - if [ "$1" ] && [ "$1" = "--check" ]; then + if [ "$1" ] && [ "$1" = "-c" ]; then if check_distro_commit; then echo -e "${GREEN}This${ENDCOLOR} is the latest version of immudex"; else @@ -60,7 +61,7 @@ if [ "$1" ]; then echo "==================================================="; check_distro_commit --print; fi - elif [ "$1" ] && [ "$1" = "--upgrade" ]; then + elif [ "$1" ] && [ "$1" = "-u" ]; then part=$(blkid | grep 'LABEL="immudex"' | awk '{printf $1}' | cut -d ":" -f 1); if mount | grep -q "$part"; then echo -n "Mounting iso image..."; @@ -117,7 +118,7 @@ if [ "$1" ]; then fi fi fi - elif [ "$1" ] && [ "$1" = "--myversion" ]; then + elif [ "$1" ] && [ "$1" = "-m" ]; then #if [ -d /tmp/immudex ]; then # (cd /tmp/immudex && git pull > /dev/null 2>&1) #else @@ -125,14 +126,13 @@ if [ "$1" ]; then #fi #(cd /tmp/immudex && git show $(cat /run/live/medium/live/version)) cat /run/live/medium/live/changelog; - elif [ "$1" ] && [ "$1" = "--packages-upgradable" ]; then + elif [ "$1" ] && [ "$1" = "-p" ]; then apt update; - if [ "$2" ] && [ "$2" = "--security" ]; then - apt list --upgradable | grep 'security'; - else - apt list --upgradable; - fi - elif [ "$1" ] && [ "$1" = "--compilation-date" ]; then + apt list --upgradable; + elif [ "$1" ] && [ "$1" = "-s" ]; then + apt update; + apt list --upgradable | grep 'security'; + elif [ "$1" ] && [ "$1" = "-d" ]; then eval $(grep '^COMPILATION_DATE' /run/live/medium/live/changelog); echo "Image was created: $COMPILATION_DATE"; else diff --git a/versions/base.sh b/versions/base.sh index df32e2a..c01f160 100644 --- a/versions/base.sh +++ b/versions/base.sh @@ -74,6 +74,10 @@ systemctl enable immudex-hostname.service; if [ ! -d /usr/share/man/man1 ]; then mkdir /usr/share/man/man1; fi cp -vv ~/immudex/tools/man/* /usr/share/man/man1; +if [ -d /usr/share/bash-completion/completions ]; then + cp -vv ~/immudex/tools/completions/* /usr/share/bash-completion/completions; +fi + mkdir /etc/skel/.irssi cp -vv ~/immudex/files/config /etc/skel/.irssi;