|
@ -113,6 +113,48 @@ sed -ri 's/^# (export LS_OPTIONS=.--color=auto.)/\1/; |
|
|
EOF |
|
|
EOF |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
if [ -d "/usr/share/nano" && ! -e "/usr/share/nano/yaml.nanorc" ]; then |
|
|
|
|
|
Wrap -d "Enable colored yaml syntax in nano" <<EOF || exit 1 |
|
|
|
|
|
cat << 'EOF' > /usr/share/nano/yaml.nanorc |
|
|
|
|
|
# Supports `YAML` files |
|
|
|
|
|
syntax "YAML" "\.ya?ml$" |
|
|
|
|
|
header "^(---|===)" "%YAML" |
|
|
|
|
|
|
|
|
|
|
|
## Keys |
|
|
|
|
|
color brightmagenta "^\s*[\$A-Za-z0-9_-]+\:" |
|
|
|
|
|
color brightmagenta "^\s*@[\$A-Za-z0-9_-]+\:" |
|
|
|
|
|
|
|
|
|
|
|
## Values |
|
|
|
|
|
color yellow ":\s.+$" |
|
|
|
|
|
## Booleans |
|
|
|
|
|
icolor brightcyan " (y|yes|n|no|true|false|on|off)$" |
|
|
|
|
|
## Numbers |
|
|
|
|
|
color brightred " [[:digit:]]+(\.[[:digit:]]+)?" |
|
|
|
|
|
## Arrays |
|
|
|
|
|
color red "\[" "\]" ":\s+[|>]" "^\s*- " |
|
|
|
|
|
## Reserved |
|
|
|
|
|
color green "(^| )!!(binary|bool|float|int|map|null|omap|seq|set|str) " |
|
|
|
|
|
|
|
|
|
|
|
## Comments |
|
|
|
|
|
color cyan "#.*$" |
|
|
|
|
|
|
|
|
|
|
|
## Errors |
|
|
|
|
|
##color ,red ":\w.+$" |
|
|
|
|
|
##color ,red ":'.+$" |
|
|
|
|
|
##color ,red ":".+$" |
|
|
|
|
|
##color ,red "\s+$" |
|
|
|
|
|
|
|
|
|
|
|
## Non closed quote |
|
|
|
|
|
color ,red "['\"][^['\"]]*$" |
|
|
|
|
|
|
|
|
|
|
|
## Closed quotes |
|
|
|
|
|
color yellow "['\"].*['\"]" |
|
|
|
|
|
|
|
|
|
|
|
## Equal sign |
|
|
|
|
|
color white ":( |$)" |
|
|
|
|
|
EOF |
|
|
|
|
|
EOF |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
for keyfile in {/root,/home/debian}/.ssh/authorized_keys; do |
|
|
for keyfile in {/root,/home/debian}/.ssh/authorized_keys; do |
|
|
[ -e "$keyfile" ] || continue |
|
|
[ -e "$keyfile" ] || continue |
|
|