diff options
author | Alan Lacerda <alacerda@alpinelinux.org> | 2015-07-17 14:07:33 +0000 |
---|---|---|
committer | Alan Lacerda <alacerda@alpinelinux.org> | 2015-07-17 14:07:33 +0000 |
commit | 33e94f325e9cb2982cb9884b7c7c938810dbf8f4 (patch) | |
tree | 4b99022450d9948760fa92adedd87bd9ae92f56a | |
parent | 0f10a25e78ee36879523e37df8aa2c8cd8e8e3cc (diff) | |
download | setup-box-33e94f325e9cb2982cb9884b7c7c938810dbf8f4.tar.bz2 setup-box-33e94f325e9cb2982cb9884b7c7c938810dbf8f4.tar.xz |
setup-box: clean up
removing bashism
removing udev from default
-rwxr-xr-x | setup-box | 33 |
1 files changed, 14 insertions, 19 deletions
@@ -169,7 +169,7 @@ search_desktop() { final_serv="$final_serv "$services fi - if [ "$1" == "openbox" ]; then + if [ "$1" = "openbox" ]; then mkdir -p ~/.config/openbox cat >~/.config/openbox/menu.xml<<EOF <?xml version="1.0" encoding="UTF-8"?> @@ -271,17 +271,12 @@ optimize_serv() { # Function to execute the rc-update add against each services that were installed add_services() { for i in $@; do - if [ "$i" == "udev" ]; then - rc-update add $i - rc-update add $i-postmount - add_to_sysinit "$i $i-postmount" - elif [ "$i" == "dbus" ]; then - rc-update add $i - add_to_sysinit "$i" - elif [ "$i" == "xrdp" ]; then + if [ "$i" = "udev" ]; then + add_to_sysinit $i $i-postmount + elif [ "$i" = "xrdp" ]; then rc-update add $i rc-update add $i-sesman - elif [ "$i" == "zabbix" ]; then + elif [ "$i" = "zabbix" ]; then rc-update add $i-server else rc-update add $i @@ -297,10 +292,10 @@ add_to_sysinit() { start_services() { for i in $@; do - if [ "$i" == "udev" ]; then + if [ "$i" = "udev" ]; then rc-service $i start rc-service $i-postmount start - elif [ "$i" == "zabbix" ]; then + elif [ "$i" = "zabbix" ]; then rc-service $i-server start else rc-service $i start @@ -366,7 +361,7 @@ main () { fi # If -v was not given, lets redirect any error to the limbo - if [ "$show_error" == "0" ]; then + if [ "$show_error" = "0" ]; then exec 2&> /dev/null fi @@ -386,7 +381,7 @@ main () { create_user="1" search_desktop "$OPTARG";; s) - if [ "$OPTARG" == "networking.zabbix_monitor" ]; then + if [ "$OPTARG" = "networking.zabbix_monitor" ]; then zabbix_config="1" fi search_sub_group "$OPTARG";; @@ -411,7 +406,7 @@ main () { done shift `expr $OPTIND - 1` - if [ "$setup_alpine" == "1" ]; then + if [ "$setup_alpine" = "1" ]; then /sbin/setup-alpine fi @@ -420,12 +415,12 @@ main () { apk add $final_pack -i # Services to be added to startup (just services) - if [ "$?" == "0" ]; then + if [ "$?" = "0" ]; then optimize_serv "$final_serv" add_services $final_serv - if [ "$create_user" == "1" ]; then - if [ "x$new_user" == "x" ]; then + if [ "$create_user" = "1" ]; then + if [ "x$new_user" = "x" ]; then new_user="alpine" fi echo -e "\033[1;33m****************************************************" @@ -445,7 +440,7 @@ main () { # start of setup environments - after install the packages # but before start their services - if [ "$zabbix_config" == "1" ]; then + if [ "$zabbix_config" = "1" ]; then setup_zabbix start_services zabbix final_msg="\033[1;33mKeep note of the following information:\nDATABASE:\n" |