tweaks and changes...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2022-11-22 09:44:29 -05:00
parent ab7154030b
commit 8c95ca4f84

67
post-install Normal file → Executable file
View File

@ -40,7 +40,7 @@ USER_SCRIPT_DIR=${0}.d/user/
# System info... # System info...
if ! [ -z "$(type -t dmidecode )" ] ; then if ! [ -z "$(type -t dmidecode )" ] ; then
# XXX should we be more specific here and include model number?? # XXX should we be more specific here and include model number??
PLATFORM=$( dmidecode \ PLATFORM=$( sudo dmidecode \
| grep -A3 '^System Information' \ | grep -A3 '^System Information' \
| grep 'Version:' \ | grep 'Version:' \
| sed 's/\s*Version:\s*//' ) | sed 's/\s*Version:\s*//' )
@ -59,6 +59,7 @@ PLATFORM_SCRIPT_DIR=${SCRIPT_DIR}/platform/${PLATFORM}
FEATURES=( FEATURES=(
dir dir
dnf-config
dnf dnf
flatpak flatpak
npm npm
@ -207,6 +208,7 @@ SAVE=(
# XXX this should be split into system and user sections... # XXX this should be split into system and user sections...
ALL_FEATURES=( ALL_FEATURES=(
# system... # system...
dnf-config
dnf dnf
flatpak flatpak
snap snap
@ -215,7 +217,7 @@ ALL_FEATURES=(
start-services start-services
# user.. # user...
dir dir
syncthing syncthing
@ -226,6 +228,8 @@ ALL_FEATURES=(
start-user-services start-user-services
gnome
# keep this last... # keep this last...
scripts scripts
platform-scripts platform-scripts
@ -233,6 +237,24 @@ ALL_FEATURES=(
) )
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function feature-dnf-config(){
if [ -z "$(grep 'f_lynx/post-install' /etc/dnf/dnf.conf)" ] ; then
echo Updating config
# a bit ugly...
cat << EOF | sudo tee -a /etc/dnf/dnf.conf > /dev/null
# added by f_lynx/post-install script...
fastmirror=True
max_parallel_downloads=10
defaultyes=True
EOF
else
echo Already updated.
fi
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function feature-dir(){ function feature-dir(){
@setupList mkdir -p - ${DIR[@]} @setupList mkdir -p - ${DIR[@]}
@ -369,8 +391,8 @@ function feature-syncthing(){
# - link device # - link device
# - share ALL directory # - share ALL directory
# - wait for sync # - wait for sync
@ echo "Waiting for Syncthing to be connected with other devices manually." echo "Waiting for Syncthing to be connected with other devices manually."
@ read -p "(press any key when done)" read -p "(press any key when done)"
} }
@ -537,28 +559,29 @@ function printhelp(){ cat << EOF
Usage: $CMD [OPTIONS] Usage: $CMD [OPTIONS]
Options: Options:
-h | --help - print this message and exit. -h | --help - print this message and exit.
-d | --dry-run - report the actions but do nothing. -d | --dry-run - report the actions but do nothing.
-q | --quiet - run in quiet mode. -q | --quiet - run in quiet mode.
--list-features - list enabled features. -l | --list-features - list enabled features.
--list-all-features - list supported features. -la | --list-all-features
--list-scripts - list available scripts. - list supported features.
-ls | --list-scripts - list available scripts.
External configuration: External configuration:
-s | --source FILE - read config from file. -s | --source FILE - read config from file.
(this flag can be used multiple times) (this flag can be used multiple times)
-o | --output FILE - write config to file. -o | --output FILE - write config to file.
Feature list manipulation: Feature list manipulation:
-all - clear features -all - clear features
+all - reset features to \$ALL_FEATURES +all - reset features to \$ALL_FEATURES
-FEATURE - remove FEATURE from list -FEATURE - remove FEATURE from list
+FEATURE - add FEATURE to lost +FEATURE - add FEATURE to lost
Helpers: Helpers:
--make-platform-dir - make platform directory for current platform --make-platform-dir - make platform directory for current platform
and exit. and exit.
Default features: Default features:
@ -597,15 +620,15 @@ while ! [ -z "$1" ] ; do
;; ;;
# introspection... # introspection...
--list-features) -l|--list-features)
echo ${FEATURES[@]} echo ${FEATURES[@]}
exit exit
;; ;;
--list-all-features) -la|--list-all-features)
echo ${ALL_FEATURES[@]} echo ${ALL_FEATURES[@]}
exit exit
;; ;;
--list-scripts) -ls|--list-scripts)
listScripts listScripts
exit exit
;; ;;