# # Copyright (C) SUSE LINUX GmbH 2016, all rights reserved. # # This library is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published # by the Free Software Foundation; either version 2.1 of the License, or # (at your option) version 3. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public # License for more details. . /rapido.conf alias shutdown='echo 1 > /proc/sys/kernel/sysrq && echo o > /proc/sysrq-trigger' alias reboot='echo 1 > /proc/sys/kernel/sysrq && echo b > /proc/sysrq-trigger' alias vi='vim' alias view='vim -R' alias l='ls -la' function _ini_parse() { local ini_file=$1 local ini_section=$2 shift 2 local ini_keys="$@" local ini_keys_re="" # generate a sed regexp for each key for i in $ini_keys; do ini_keys_re="$ini_keys_re /^$i\=.*/p;" done eval `sed -e 's/[[:space:]]*\=[[:space:]]*/=/' \ -e 's/;.*$//' \ -e 's/[[:space:]]*$//' \ -e 's/^[[:space:]]*//' \ -e "s/^\(.*\)=\([^\"']*\)$/\1=\2/" \ -e ':b; s/^\([^=]*\)* /\1_/; tb;' \ -n -e "/^\[$ini_section\]/,/^\s*\[/ { \ $ini_keys_re }" \ < $ini_file` } function _fatal() { shutdown sleep 2 } resize export PS1="$(cat /proc/sys/kernel/hostname):\${PWD}# "