diff --git a/LICENSE b/LICENSE index ea890af..9e015a9 100644 --- a/LICENSE +++ b/LICENSE @@ -1,11 +1,29 @@ -Copyright (c) . +Copyright 2013-2022 Geoffray Levasseur -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: +This is distributed with BSD-3-Clause license with the following terms and +condition: -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +3. Neither the name of the copyright holder nor the names of its contributors +may be used to endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/history.txt b/history.txt new file mode 100644 index 0000000..c06e42c --- /dev/null +++ b/history.txt @@ -0,0 +1,118 @@ +------------------------------------------------------------------------------ +Initial version from Beyond Linux From Scratch by + * James Robertson + * Dagmar d'Surreal +------------------------------------------------------------------------------ +Current version from Geoffray Levasseur +------------------------------------------------------------------------------ +Version history: +------------------------------------------------------------------------------ +# 20/11/2022 v3.2.1 + Fix some messages + Make dpkgs rpm aware (more to come) + Removed version history from main script and revert declaration order + Added required license information in all files + Completed LICENSE file + +# 18/11/2022 v3.2.0 + Created disp command for display and make use of it + +# 10/11/2022 v3.1.1 + genpwd: test if password is doable + +# 08/11/2022 v3.1.0 + Added password generator + +# 07/11/2022 v3.0.1 + Added concatenation to rmspc + Added ku + Error managed in meteo + +# 27/08/2022 v3.0.0 + Splitted everything in several files + Added rain screensaver + +# 29/07/2022 v2.8.2 + Added warning for non bash or zsh users + +# 19/07/2022 v2.8.1 + Few cleanups, fixes and optimizations + +# 24/06/2022 v2.8.0 + Added backtrace, error and settrace + [bugfix] corrected showinfo + +# 22/06/2022 v2.7.1 + [bugfix] few minor corrections + Added help command + +# 21/06/2022 v2.7.0 + Added isipv4 and isipv6 and use it in rmhost as an improvement + Removed konsole save and restore not working + +# 18/10/2021 v2.6.3 + Changed PS1 for status bar style version + Few minor improvements + +# 26/02/2021 v2.6.2 + [bugfix] taz: corrected bug with trailing slash on directories + +# 25/12/2020 v2.6.1 + Add check on rmhost + Improvements rmspc + Created expendlist + +# 24/10/2020 v2.6.0 + Added session save and restore for Konsole + +# 11/09/2020 v2.5.3 + Few more aliases, improved code consistancy and typo, + Improved utaz, removed showdiskmap, removed remaining French, + Added license information for future publication + +# 06/03/2020 v2.5.2 + Few aliases sorted out + +# 05/03/2020 v2.5.1 + Language consistancy fix + Added pigz support in taz + +# 03/03/2020 v2.5.0 + Added command taz and rmspc + Renamed auzip => utaz and improved it + +# 02/03/2020 v2.4.0 + Added command auzip + +# 31/01/2020 v2.3.2 + Figlet: changed default font to ansi_shadow + +# 16/01/2020 v2.3.1 + [bugfix] non-interactive were blocked with some functions + +# 08/01/2020 v2.3.0 + Added use of figlet and neofetch as a motd replace + +# 16/12/2019 v2.2.0 + Added showinfo + Primary write of showdiskmap + +# 24/09/2019 v2.1.2 + [bugfix] bug in profile version display + +# 23/09/2019 v2.1.1 + [bugfix] dpkgs + +# 16/09/2018 v2.1.0 + Added rmhost, setc, setfr + More locales management + +# 04/02/2017 v2.0.1 + clean improvements (--shell) + +# 24/10/2015 v2.0.0 + Added advanced functionnalities (clean, srr, etc.) + +# 16/02/2013 v1.0.0 + Initial version + diff --git a/profile.d/compress.sh b/profile.d/compress.sh index 1e1aa90..2e85bca 100644 --- a/profile.d/compress.sh +++ b/profile.d/compress.sh @@ -1,3 +1,38 @@ +# ------------------------------------------------------------------------------ +# Copyright (c) 2013-2022 Geoffray Levasseur +# Protected by the BSD3 license. Please read bellow for details. +# +# * Redistribution and use in source and binary forms, +# * with or without modification, are permitted provided +# * that the following conditions are met: +# * +# * Redistributions of source code must retain the above +# * copyright notice, this list of conditions and the +# * following disclaimer. +# * +# * Redistributions in binary form must reproduce the above +# * copyright notice, this list of conditions and the following +# * disclaimer in the documentation and/or other materials +# * provided with the distribution. +# * +# * Neither the name of the copyright holder nor the names +# * of any other contributors may be used to endorse or +# * promote products derived from this software without +# * specific prior written permission. +# * +# * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +# * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +# * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +# * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# * OF SUCH DAMAGE. +# ------------------------------------------------------------------------------ + # ------------------------------------------------------------------------------ # Smartly uncompress archives (zip only) # ------------------------------------------------------------------------------ diff --git a/profile.d/debug.sh b/profile.d/debug.sh index fab3e3c..03135e9 100644 --- a/profile.d/debug.sh +++ b/profile.d/debug.sh @@ -1,3 +1,38 @@ +# ------------------------------------------------------------------------------ +# Copyright (c) 2013-2022 Geoffray Levasseur +# Protected by the BSD3 license. Please read bellow for details. +# +# * Redistribution and use in source and binary forms, +# * with or without modification, are permitted provided +# * that the following conditions are met: +# * +# * Redistributions of source code must retain the above +# * copyright notice, this list of conditions and the +# * following disclaimer. +# * +# * Redistributions in binary form must reproduce the above +# * copyright notice, this list of conditions and the following +# * disclaimer in the documentation and/or other materials +# * provided with the distribution. +# * +# * Neither the name of the copyright holder nor the names +# * of any other contributors may be used to endorse or +# * promote products derived from this software without +# * specific prior written permission. +# * +# * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +# * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +# * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +# * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# * OF SUCH DAMAGE. +# ------------------------------------------------------------------------------ + # ------------------------------------------------------------------------------ # Display a backtrace # ------------------------------------------------------------------------------ diff --git a/profile.d/disp.sh b/profile.d/disp.sh index 0c336bf..2976a47 100644 --- a/profile.d/disp.sh +++ b/profile.d/disp.sh @@ -1,3 +1,39 @@ +# ------------------------------------------------------------------------------ +# Copyright (c) 2013-2022 Geoffray Levasseur +# Protected by the BSD3 license. Please read bellow for details. +# +# * Redistribution and use in source and binary forms, +# * with or without modification, are permitted provided +# * that the following conditions are met: +# * +# * Redistributions of source code must retain the above +# * copyright notice, this list of conditions and the +# * following disclaimer. +# * +# * Redistributions in binary form must reproduce the above +# * copyright notice, this list of conditions and the following +# * disclaimer in the documentation and/or other materials +# * provided with the distribution. +# * +# * Neither the name of the copyright holder nor the names +# * of any other contributors may be used to endorse or +# * promote products derived from this software without +# * specific prior written permission. +# * +# * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +# * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +# * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +# * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# * OF SUCH DAMAGE. +# ------------------------------------------------------------------------------ + +# ------------------------------------------------------------------------------ # Color definitions # ------------------------------------------------------------------------------ # Standard 16 colors display declaration diff --git a/profile.d/filefct.sh b/profile.d/filefct.sh index 36c306c..3067dfa 100644 --- a/profile.d/filefct.sh +++ b/profile.d/filefct.sh @@ -1,3 +1,38 @@ +# ------------------------------------------------------------------------------ +# Copyright (c) 2013-2022 Geoffray Levasseur +# Protected by the BSD3 license. Please read bellow for details. +# +# * Redistribution and use in source and binary forms, +# * with or without modification, are permitted provided +# * that the following conditions are met: +# * +# * Redistributions of source code must retain the above +# * copyright notice, this list of conditions and the +# * following disclaimer. +# * +# * Redistributions in binary form must reproduce the above +# * copyright notice, this list of conditions and the following +# * disclaimer in the documentation and/or other materials +# * provided with the distribution. +# * +# * Neither the name of the copyright holder nor the names +# * of any other contributors may be used to endorse or +# * promote products derived from this software without +# * specific prior written permission. +# * +# * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +# * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +# * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +# * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# * OF SUCH DAMAGE. +# ------------------------------------------------------------------------------ + # ------------------------------------------------------------------------------ # expandlist : treat wildcards in a file/directory list # ------------------------------------------------------------------------------ @@ -112,7 +147,7 @@ rmspc () echo " -h, --help Display that help screen" echo " -r, --recursive Treat subdirectories of the given directory" echo " -c, --subst-char Change the replacement character (default is underscore)" - echo " -v, --verbose Display what is being done" + echo " -v, --verbose Display more details (recursive mode only)" echo " -s, --shell Do nothing and display commands that would be executed" echo echo "Note: if the --subst-char option is given without parameters, spaces will be" diff --git a/profile.d/help.sh b/profile.d/help.sh index 40b5b8a..a529c30 100644 --- a/profile.d/help.sh +++ b/profile.d/help.sh @@ -1,3 +1,38 @@ +# ------------------------------------------------------------------------------ +# Copyright (c) 2013-2022 Geoffray Levasseur +# Protected by the BSD3 license. Please read bellow for details. +# +# * Redistribution and use in source and binary forms, +# * with or without modification, are permitted provided +# * that the following conditions are met: +# * +# * Redistributions of source code must retain the above +# * copyright notice, this list of conditions and the +# * following disclaimer. +# * +# * Redistributions in binary form must reproduce the above +# * copyright notice, this list of conditions and the following +# * disclaimer in the documentation and/or other materials +# * provided with the distribution. +# * +# * Neither the name of the copyright holder nor the names +# * of any other contributors may be used to endorse or +# * promote products derived from this software without +# * specific prior written permission. +# * +# * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +# * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +# * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +# * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# * OF SUCH DAMAGE. +# ------------------------------------------------------------------------------ + # ------------------------------------------------------------------------------ # Display list of commands and general informations # ------------------------------------------------------------------------------ diff --git a/profile.d/info.sh b/profile.d/info.sh index 09e96f0..be0532e 100644 --- a/profile.d/info.sh +++ b/profile.d/info.sh @@ -1,3 +1,38 @@ +# ------------------------------------------------------------------------------ +# Copyright (c) 2013-2022 Geoffray Levasseur +# Protected by the BSD3 license. Please read bellow for details. +# +# * Redistribution and use in source and binary forms, +# * with or without modification, are permitted provided +# * that the following conditions are met: +# * +# * Redistributions of source code must retain the above +# * copyright notice, this list of conditions and the +# * following disclaimer. +# * +# * Redistributions in binary form must reproduce the above +# * copyright notice, this list of conditions and the following +# * disclaimer in the documentation and/or other materials +# * provided with the distribution. +# * +# * Neither the name of the copyright holder nor the names +# * of any other contributors may be used to endorse or +# * promote products derived from this software without +# * specific prior written permission. +# * +# * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +# * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +# * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +# * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# * OF SUCH DAMAGE. +# ------------------------------------------------------------------------------ + # ------------------------------------------------------------------------------ # Show profile version # ------------------------------------------------------------------------------ diff --git a/profile.d/lang.sh b/profile.d/lang.sh index 70c8912..35d0441 100644 --- a/profile.d/lang.sh +++ b/profile.d/lang.sh @@ -1,3 +1,38 @@ +# ------------------------------------------------------------------------------ +# Copyright (c) 2013-2022 Geoffray Levasseur +# Protected by the BSD3 license. Please read bellow for details. +# +# * Redistribution and use in source and binary forms, +# * with or without modification, are permitted provided +# * that the following conditions are met: +# * +# * Redistributions of source code must retain the above +# * copyright notice, this list of conditions and the +# * following disclaimer. +# * +# * Redistributions in binary form must reproduce the above +# * copyright notice, this list of conditions and the following +# * disclaimer in the documentation and/or other materials +# * provided with the distribution. +# * +# * Neither the name of the copyright holder nor the names +# * of any other contributors may be used to endorse or +# * promote products derived from this software without +# * specific prior written permission. +# * +# * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +# * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +# * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +# * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# * OF SUCH DAMAGE. +# ------------------------------------------------------------------------------ + # ------------------------------------------------------------------------------ # Change locale to French # ------------------------------------------------------------------------------ diff --git a/profile.d/net.sh b/profile.d/net.sh index 6ef2f4f..2aa59c9 100644 --- a/profile.d/net.sh +++ b/profile.d/net.sh @@ -1,3 +1,38 @@ +# ------------------------------------------------------------------------------ +# Copyright (c) 2013-2022 Geoffray Levasseur +# Protected by the BSD3 license. Please read bellow for details. +# +# * Redistribution and use in source and binary forms, +# * with or without modification, are permitted provided +# * that the following conditions are met: +# * +# * Redistributions of source code must retain the above +# * copyright notice, this list of conditions and the +# * following disclaimer. +# * +# * Redistributions in binary form must reproduce the above +# * copyright notice, this list of conditions and the following +# * disclaimer in the documentation and/or other materials +# * provided with the distribution. +# * +# * Neither the name of the copyright holder nor the names +# * of any other contributors may be used to endorse or +# * promote products derived from this software without +# * specific prior written permission. +# * +# * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +# * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +# * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +# * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# * OF SUCH DAMAGE. +# ------------------------------------------------------------------------------ + # ------------------------------------------------------------------------------ # Determine if parameter is a valid IPv4 address # ------------------------------------------------------------------------------ diff --git a/profile.d/packages.sh b/profile.d/packages.sh index eb78d8b..f85c51f 100644 --- a/profile.d/packages.sh +++ b/profile.d/packages.sh @@ -1,3 +1,38 @@ +# ------------------------------------------------------------------------------ +# Copyright (c) 2013-2022 Geoffray Levasseur +# Protected by the BSD3 license. Please read bellow for details. +# +# * Redistribution and use in source and binary forms, +# * with or without modification, are permitted provided +# * that the following conditions are met: +# * +# * Redistributions of source code must retain the above +# * copyright notice, this list of conditions and the +# * following disclaimer. +# * +# * Redistributions in binary form must reproduce the above +# * copyright notice, this list of conditions and the following +# * disclaimer in the documentation and/or other materials +# * provided with the distribution. +# * +# * Neither the name of the copyright holder nor the names +# * of any other contributors may be used to endorse or +# * promote products derived from this software without +# * specific prior written permission. +# * +# * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +# * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +# * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +# * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# * OF SUCH DAMAGE. +# ------------------------------------------------------------------------------ + # ------------------------------------------------------------------------------ # Look for a package within installed one # ------------------------------------------------------------------------------ @@ -14,7 +49,7 @@ dpkgs () ;; "-"*) - echo "Invalid option, use \"dpkgs --help\" to display usage." + disp E "Invalid option, use \"dpkgs --help\" to display usage." echo return 1 ;; @@ -33,10 +68,13 @@ dpkgs () disp E "Please specify a package name, without space, eventually partial." && return 1 - [[ -x /usr/sbin/dpkg ]] && - disp E "dpkg command seems unavialable." && - return 2 - - dpkg -l | grep $pkg + if [[ $(command -v dpkg >/dev/null 2>&1) ]]; then + dpkg -l | grep $pkg + elif [[ $(command -v dpkg >/dev/null 2>&1) ]]; then + rpm -qa | grep $pkg + else + disp E "No usable package manager seems unavialable." + return 2 + fi } export -f dpkgs diff --git a/profile.d/processes.sh b/profile.d/processes.sh index a484887..80c4d28 100644 --- a/profile.d/processes.sh +++ b/profile.d/processes.sh @@ -1,3 +1,38 @@ +# ------------------------------------------------------------------------------ +# Copyright (c) 2013-2022 Geoffray Levasseur +# Protected by the BSD3 license. Please read bellow for details. +# +# * Redistribution and use in source and binary forms, +# * with or without modification, are permitted provided +# * that the following conditions are met: +# * +# * Redistributions of source code must retain the above +# * copyright notice, this list of conditions and the +# * following disclaimer. +# * +# * Redistributions in binary form must reproduce the above +# * copyright notice, this list of conditions and the following +# * disclaimer in the documentation and/or other materials +# * provided with the distribution. +# * +# * Neither the name of the copyright holder nor the names +# * of any other contributors may be used to endorse or +# * promote products derived from this software without +# * specific prior written permission. +# * +# * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +# * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +# * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +# * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# * OF SUCH DAMAGE. +# ------------------------------------------------------------------------------ + # ------------------------------------------------------------------------------ # Search processes matching the given string # ------------------------------------------------------------------------------ diff --git a/profile.d/prompt.sh b/profile.d/prompt.sh index 9b136b8..e5f8f36 100644 --- a/profile.d/prompt.sh +++ b/profile.d/prompt.sh @@ -1,3 +1,38 @@ +# ------------------------------------------------------------------------------ +# Copyright (c) 2013-2022 Geoffray Levasseur +# Protected by the BSD3 license. Please read bellow for details. +# +# * Redistribution and use in source and binary forms, +# * with or without modification, are permitted provided +# * that the following conditions are met: +# * +# * Redistributions of source code must retain the above +# * copyright notice, this list of conditions and the +# * following disclaimer. +# * +# * Redistributions in binary form must reproduce the above +# * copyright notice, this list of conditions and the following +# * disclaimer in the documentation and/or other materials +# * provided with the distribution. +# * +# * Neither the name of the copyright holder nor the names +# * of any other contributors may be used to endorse or +# * promote products derived from this software without +# * specific prior written permission. +# * +# * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +# * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +# * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +# * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# * OF SUCH DAMAGE. +# ------------------------------------------------------------------------------ + # ------------------------------------------------------------------------------ # timer_* functions : internal timing function for prompt # ------------------------------------------------------------------------------ diff --git a/profile.d/pwd.sh b/profile.d/pwd.sh index 9fcf5c9..ce5fb3b 100755 --- a/profile.d/pwd.sh +++ b/profile.d/pwd.sh @@ -1,3 +1,38 @@ +# ------------------------------------------------------------------------------ +# Copyright (c) 2013-2022 Geoffray Levasseur +# Protected by the BSD3 license. Please read bellow for details. +# +# * Redistribution and use in source and binary forms, +# * with or without modification, are permitted provided +# * that the following conditions are met: +# * +# * Redistributions of source code must retain the above +# * copyright notice, this list of conditions and the +# * following disclaimer. +# * +# * Redistributions in binary form must reproduce the above +# * copyright notice, this list of conditions and the following +# * disclaimer in the documentation and/or other materials +# * provided with the distribution. +# * +# * Neither the name of the copyright holder nor the names +# * of any other contributors may be used to endorse or +# * promote products derived from this software without +# * specific prior written permission. +# * +# * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +# * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +# * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +# * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# * OF SUCH DAMAGE. +# ------------------------------------------------------------------------------ + # ------------------------------------------------------------------------------ # genpwd : generate a password with different criteria # default 16 car with up and low car, symbol and number @@ -13,7 +48,7 @@ genpwd() for opt in $@; do case $opt in "-h"|"--help") - echo "genpwd: generate a secure random password." + echo "genpwd: generate one or more secure random password." echo echo "Usage: genpwd [options] [--extracars=] [--length=] [nb_passwd]" echo diff --git a/profile.d/rain.sh b/profile.d/rain.sh index b60c53d..63e1d61 100644 --- a/profile.d/rain.sh +++ b/profile.d/rain.sh @@ -1,3 +1,38 @@ +# ------------------------------------------------------------------------------ +# Copyright (c) 2013-2022 Geoffray Levasseur +# Protected by the BSD3 license. Please read bellow for details. +# +# * Redistribution and use in source and binary forms, +# * with or without modification, are permitted provided +# * that the following conditions are met: +# * +# * Redistributions of source code must retain the above +# * copyright notice, this list of conditions and the +# * following disclaimer. +# * +# * Redistributions in binary form must reproduce the above +# * copyright notice, this list of conditions and the following +# * disclaimer in the documentation and/or other materials +# * provided with the distribution. +# * +# * Neither the name of the copyright holder nor the names +# * of any other contributors may be used to endorse or +# * promote products derived from this software without +# * specific prior written permission. +# * +# * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +# * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +# * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +# * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# * OF SUCH DAMAGE. +# ------------------------------------------------------------------------------ + # ------------------------------------------------------------------------------ # Let the rain fall # ------------------------------------------------------------------------------ diff --git a/profile.d/ssh.sh b/profile.d/ssh.sh index 7b43f99..ac5b3f7 100644 --- a/profile.d/ssh.sh +++ b/profile.d/ssh.sh @@ -1,3 +1,38 @@ +# ------------------------------------------------------------------------------ +# Copyright (c) 2013-2022 Geoffray Levasseur +# Protected by the BSD3 license. Please read bellow for details. +# +# * Redistribution and use in source and binary forms, +# * with or without modification, are permitted provided +# * that the following conditions are met: +# * +# * Redistributions of source code must retain the above +# * copyright notice, this list of conditions and the +# * following disclaimer. +# * +# * Redistributions in binary form must reproduce the above +# * copyright notice, this list of conditions and the following +# * disclaimer in the documentation and/or other materials +# * provided with the distribution. +# * +# * Neither the name of the copyright holder nor the names +# * of any other contributors may be used to endorse or +# * promote products derived from this software without +# * specific prior written permission. +# * +# * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +# * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +# * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +# * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# * OF SUCH DAMAGE. +# ------------------------------------------------------------------------------ + # ------------------------------------------------------------------------------ # Remove host from know_host (name and IP) for the active user # ------------------------------------------------------------------------------ diff --git a/profile.sh b/profile.sh index 96ac8bb..069e244 100644 --- a/profile.sh +++ b/profile.sh @@ -1,43 +1,6 @@ #!/bin/bash # Begin profile # ------------------------------------------------------------------------------ -# Initial version from Beyond Linux From Scratch by -# * James Robertson -# * Dagmar d'Surreal -# ------------------------------------------------------------------------------ -# Current version from Geoffray Levasseur -# 16/02/2013 v1.0.0 : Initial version -# 24/10/2015 v2.0.0 : Added advanced functionnalities (clean, srr, etc.) -# 04/02/2017 v2.0.1 : clean improvements (--shell) -# 16/09/2018 v2.1.0 : Added rmhost, setc, setfr, more locales management -# 23/09/2019 v2.1.1 : [bugfix] dpkgs -# 24/09/2019 v2.1.2 : [bugfix] bug in profile version display -# 16/12/2019 v2.2.0 : Added showinfo, primary write of showdiskmap -# 08/01/2020 v2.3.0 : Added use of figlet and neofetch as a motd replace -# 16/01/2020 v2.3.1 : [bugfix] non-interactive were blocked with some functions -# 31/01/2020 v2.3.2 : Figlet: changed default font to ansi_shadow -# 02/03/2020 v2.4.0 : Added command auzip -# 03/03/2020 v2.5.0 : Added command taz and rmspc, auzip => utaz improved -# 05/03/2020 v2.5.1 : Language consistancy fix, added pigz support in taz -# 06/03/2020 v2.5.2 : Few aliases sorted out -# 11/09/2020 v2.5.3 : Few more aliases, improved code consistancy and typo, -# : improved utaz, removed showdiskmap, removed remaining French, -# : added license information for future publication -# 24/10/2020 v2.6.0 : Added session save and restore for Konsole -# 25/12/2020 v2.6.1 : Add check on rmhost, improvements rmspc, created expendlist -# 26/02/2021 v2.6.2 : [bugfix] taz: corrected bug with trailing slash on directories -# 18/10/2021 v2.6.3 : changed PS1 for status bar style version, few minor improvements -# 21/06/2022 v2.7.0 : added isipv4 and isipv6, use it in rmhost as an improvement -# 22/06/2022 v2.7.1 : [bugfix] few minor corrections, added help command -# 24/06/2022 v2.8.0 : Added backtrace, error and settrace, corrected showinfo -# 19/07/2022 v2.8.1 : few cleanup, fixes and optimizations -# 29/07/2022 v2.8.2 : added warning for non bash users -# 27/08/2022 v3.0.0 : splitted everything, added rain screensaver -# 07/11/2022 v3.0.1 : added concatenation to rmspc, added ku, error managed in meteo -# 08/11/2022 v3.1.0 : added password generator -# 10/11/2022 v3.1.1 : genpwd: test if password is doable -# 18/11/2022 v3.2.0 : created disp command for display, make use of it -# ------------------------------------------------------------------------------ # Copyright (c) 2013-2022 Geoffray Levasseur # Protected by the BSD3 license. Please read bellow for details. # @@ -72,7 +35,7 @@ # * OF SUCH DAMAGE. # ------------------------------------------------------------------------------ -export PROFVERSION="3.2.0" +export PROFVERSION="3.2.1" export DEFAULT_CITY="Toulouse"