diff --git a/board/common/rootfs/etc/profile.d/convenience.sh b/board/common/rootfs/etc/profile.d/convenience.sh index 05235ff3..08eb105f 100644 --- a/board/common/rootfs/etc/profile.d/convenience.sh +++ b/board/common/rootfs/etc/profile.d/convenience.sh @@ -4,14 +4,14 @@ alias ll='ls -alF' alias ls='ls --color=auto' export LANG=C.UTF-8 -export EDITOR=/usr/bin/edit -export VISUAL=/usr/bin/edit +export EDITOR=/usr/bin/editor +export VISUAL=/usr/bin/editor export LESS="-P %f (press h for help or q to quit)" export LESSOPEN="|/usr/bin/lesspipe.sh %s" alias vim='vi' alias view='vi -R' alias emacs='mg' -alias sensible-editor=edit +alias sensible-editor=editor alias sensible-pager=pager alias hd="hexdump -C" diff --git a/board/common/rootfs/usr/bin/cfg b/board/common/rootfs/usr/bin/cfg deleted file mode 100755 index 7e539b27..00000000 --- a/board/common/rootfs/usr/bin/cfg +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/sh -# User-friendly wrapper for sysrepocfg -# TODO: add import/export, copy, ... - -# Edit YANG binary types using sysrepo, base64, and duct tape. -edit() -{ - xpath=$1 - if [ -z "$xpath" ]; then - echo "Usage: cfg edit \"/full/xpath/to/binary/leaf\"" - exit 1 - fi - - if tmp=$(sysrepocfg -G "$xpath"); then - file=$(mktemp) - - echo "$tmp" | base64 -d > "$file" - if /usr/bin/editor "$file"; then - tmp=$(base64 -w0 < "$file") - sysrepocfg -S "$xpath" -u "$tmp" - fi - - rm -f "$file" - else - echo "Failed to retrieve value for $xpath" - exit 1 - fi -} - -usage() -{ - echo "Usage:" - echo " cfg CMD [ARG]" - echo - echo "Command:" - echo " edit XPATH Edit YANG binary type" - echo " help This help text" - echo - echo "As a backwards compatible fallback, this script forwards" - echo "all other commands as options to sysrepocfg." - echo - - exit 0 -} - -cmd=$1; shift -case $cmd in - edit) - edit "$1" - ;; - help) - usage - ;; - *) - set -- "$cmd" "$@" - exec sysrepocfg -f json "$@" - ;; -esac diff --git a/board/common/rootfs/usr/bin/edit b/board/common/rootfs/usr/bin/edit deleted file mode 120000 index ddd7f859..00000000 --- a/board/common/rootfs/usr/bin/edit +++ /dev/null @@ -1 +0,0 @@ -/etc/alternatives/editor \ No newline at end of file