aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files/etc/profile
Commit message (Collapse)AuthorAgeFilesLines
* base-files: Add /etc/shinit for non-login shell initJeffery To2020-03-011-20/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because /etc/profile (and ~/.profile) are read by login shells only, aliases and functions defined there are not available to non-login shells, e.g. when using screen or tmux. If the ENV environment variable exists (exported by /etc/profile or ~/.profile) and references an existing file, then all interactive shells (login or non-login) will read that file as well. This sets the ENV environment variable in /etc/profile, pointing to /etc/shinit. This also adds /etc/shinit, which: * Contains alias and function definitions originally in /etc/profile * Sources /etc/mkshrc if the user is using mksh (also originally in /etc/profile), as /etc/mkshrc is meant for all interactive shells * Sources ~/.mkshrc if the user is using mksh, to compensate for the fact that mksh will not read ~/.mkshrc if ENV is set * Sources ~/.shinit if the user is not using mksh This also removes the shebang from /etc/profile, as the file is sourced, not executed. Signed-off-by: Jeffery To <jeffery.to@gmail.com>
* base-files: provide more tolerant xterm detectionPaul Wassi2018-08-291-1/+5
| | | | | | | | Set the window title not only in "xterm", but also in e.g. "xterm-256color", "xterm-color", etc. The case statement is taken from Debian / Ubuntu. Signed-off-by: Paul Wassi <p.wassi@gmx.at>
* base-files: fix logic when to show failsafe bannerMatthias Schiffer2017-12-291-1/+1
| | | | | | Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net> Fixes: 8170f280c4 ("base-files: set FAILSAFE in /etc/profile when /tmp/.failsafe exists")
* base-files: set FAILSAFE in /etc/profile when /tmp/.failsafe existsMatthias Schiffer2017-12-291-1/+4
| | | | | | | Since dropbear clears the environment, FAILSAFE was not set as intended in failsafe mode. This also broke sysupgrade from failsafe mode over SSH. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* base-files: fix message of initscript wrapperAlberto Bursi2017-01-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | currently (after blogic's edit to my commit) it prints like this: root@lede:/# service aa aa does not exist. the following services are available :adblock dnsmasq gpio_switch rpcd system boot done led sqm uhttpd crelay dropbear log sysctl umount cron firewall network sysfixtime urandom_seed ddns fstab odhcpd sysntpd which looks pretty bad, and is even worse if someone writes only "service" without arguments, as it will print " does not exist. " which is confusing. with this commit it looks like this: root@lede:/# service service "" not found, the following services are available: adblock dnsmasq gpio_switch rpcd system boot done led sqm uhttpd crelay dropbear log sysctl umount cron firewall network sysfixtime urandom_seed ddns fstab odhcpd sysntpd Yes there is some play with " and ', it is to display "name" or just "" if no service name is entered (like in the example). Signed-off-by: Alberto Bursi <alberto.bursi@outlook.it>
* base-files: add a wrapper for init scripts in profileAlberto Bursi2016-11-291-0/+9
| | | | | | | | | | | "service" is a simple wrapper that will allow to call init.d scripts current method: # /etc/init.d/network reload with the wrapper: # service network reload If the wrapper is called without arguments or with a wrong init script name, it will print an error and list the content of /etc/init.d/ folder Signed-off-by: Alberto Bursi <alberto.bursi@outlook.it>
* base-files: Prefer busybox arp over /proc/net/arp aliasMarek Lindner2016-11-101-1/+1
| | | | | | | | | A firmware compiled with BUSYBOX_CONFIG_ARP should also use by default the arp binary from busybox. Otherwise the extra functionality the user requested can only be used when running arp with the path to the binary. Signed-off-by: Marek Lindner <marek.lindner@open-mesh.com> Signed-off-by: Sven Eckelmann <sven.eckelmann@open-mesh.com>
* base-files: fix check for empty password warningMatthias Schiffer2016-09-261-2/+1
| | | | | | | | | | | | | Now that we know that the password is in /etc/shadow and not in /etc/passwd, we can properly fix the logic for the empty password check. Only 'root::' is an empty password, 'root:x:' and 'root:!:' allow no password login at all. This fixes the empty password warning still showing after the root password has been locked using 'passwd -l root' (e.g. to allow public-key auth only). Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* base-files: remind users to set root passwordJohn Crispin2016-09-191-0/+13
| | | | | | print a warning when a shell spawns, telling users to set a root password. Signed-off-by: John Crispin <john@phrozen.org>
* base-files: Enhancements to /etc/profileVittorio G (VittGam)2016-05-141-0/+4
| | | | | | - Update the terminal window title with the current directory and hostname, if using an xterm-compatible terminal emulator. - Add ll, an useful alias to ls. Signed-off-by: Vittorio Gambaletta <openwrt@vittgam.net>
* base-files: honor CONFIG_TARGET_INIT_PATHJo-Philipp Wich2016-02-081-1/+1
| | | | | | Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> SVN-Revision: 48678
* base-files: show hint when JFFS2-partition is full and overlayfs mounted ↵John Crispin2015-11-241-0/+4
| | | | | | | | | | | | | | | | | read-only since r45833 and r45848 the overlayfs is automatically mounted read-only (and blocks remounts as r/w) when JFFS2 is full. see ticket #19564 because of this normal file deletion is not possible anymore. if a user logins interactively (e.g. SSH) show a hint for this, that files must be removed in /overlay/upper/... v2: fix subject line Signed-off-by: Bastian Bittorf <bittorf@bluebottle.com> SVN-Revision: 47623
* base-files: sanitize and unify $PATHSteven Barth2015-10-021-1/+1
| | | | | | | | Previously init and hotplug paths were different from console. Signed-off-by: Steven Barth <steven@midlink.org> SVN-Revision: 47080
* base-files: add /etc/profile.d supportJohn Crispin2015-09-161-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | OpenWrt should support an optional /etc/profile.d directory like most other Linux distributions. This allows packages to install their own scripts into /etc/profile.d/ directory. The file suffix should make clear, that these scripts are (sourced) shell-snippets. If the user needs e.g. php or lua, one must make sure that the interpreter is called. The reverse failsafe test makes sure, that the effective returncode is 0. A typcal usecase is the inclusion of private helpers, special variables or aliases, which at the moment needs patching the sourcecode and is not well maintainable. Now the builder can simply add there files. v1 initial work of Hendrik Lüth <hendrik@linux-nerds.de> v2 changes regarding RFC (e.g. thomas.langer@lantiq.com) v3 changes regarding RFC (e.g. mschiffer@universe-factory.net) v4 keep it simple and mimic OpenWrt style Signed-off-by: Bastian Bittorf <bittorf@bluebottle.com> SVN-Revision: 46965
* failsafe-mode: print short help on commandlineJohn Crispin2014-10-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [base-files] failsafe-mode: print short help on commandline Like mentioned in ticket https://dev.openwrt.org/ticket/11911 this should make the IRC much quieter. Failsafe is somehow special and even experienced users are helpless, because they are not used to this seldom situation. Also: likely you have no internet access in this mode, so you cannot use the wiki. a failsafe-session now looks like this: first we see from 'package/base-files/files/bin/login.sh' the hint: === IMPORTANT ============================ Use 'passwd' to set your login password this will disable telnet and enable SSH ------------------------------------------ after this the /etc/banner ("OpenWrt - wireless freedom") and then the new text: ================= FAILSAFE MODE active ================ special commands: * firstboot reset settings to factory defaults * mount_root mount root-partition with config files after mount_root: * passwd change root's password * /etc/config directory with config files for more help see: http://wiki.openwrt.org/doc/howto/generic.failsafe ======================================================= this supersedes the old patches: http://patchwork.openwrt.org/patch/3337/ http://patchwork.openwrt.org/patch/3553/ Signed-off-by: Bastian Bittorf <bittorf@bluebottle.com> SVN-Revision: 42985
* base-files: change PATH orderJohn Crispin2013-06-101-1/+1
| | | | | | | | | This allows packages to override busybox applets by placing the new binaries in /usr/{sbin,bin} Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 36890
* base-files: check for ldd presence and executability (#11991)Florian Fainelli2012-08-081-1/+1
| | | | SVN-Revision: 33057
* base-files: fix detection of standalone lddFlorian Fainelli2012-07-271-1/+1
| | | | | | | | When standalone ldd is selected in config the binary is installed in /usr/bin/ldd. Signed-off-by: Michael Heimpold <mhei@heimpold.de> SVN-Revision: 32891
* base-files: fix arp() procedure to properly detect /usr/bin/arpJo-Philipp Wich2011-08-121-1/+1
| | | | SVN-Revision: 27965
* fix $HOME in /etc/profile (#4424)Felix Fietkau2009-01-071-1/+2
| | | | SVN-Revision: 13914
* made HOME=/root global instead of x86 specificJohn Crispin2007-09-191-1/+1
| | | | SVN-Revision: 8845
* Prefer real executables when available (#1296)Florian Fainelli2007-05-141-3/+3
| | | | SVN-Revision: 7232
* add K* scripts to be run at shutdownMike Baker2007-05-101-1/+0
| | | | SVN-Revision: 7163
* move the last change to the right placeImre Kaloz2007-04-301-0/+1
| | | | SVN-Revision: 7069
* Add ldd and ldconfig support, template packages derived from gcc and uclibcFlorian Fainelli2007-04-031-1/+1
| | | | SVN-Revision: 6856
* Use MiBSD ksh if installed (#1470)Florian Fainelli2007-03-241-0/+2
| | | | SVN-Revision: 6687
* rename default/ to files/Felix Fietkau2006-11-221-0/+12
SVN-Revision: 5622