File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,6 +14,11 @@ auto_config_lookup_and_set(){
1414 $DEBUG && echo " lookup_set: current_status_file - $current_status_file "
1515
1616 if [ -f $filename ] ; then
17+
18+ $DEBUG && echo " Config file found"
19+ $DEBUG && echo -n " tmp (current): " && cat $current_status_file
20+ $DEBUG && echo -n " config : " && cat $filename
21+
1722 if [ " ` cat $filename ` " != " ` cat $current_status_file ` " ] ; then
1823 echo " $config - configuration is different, setting to new value"
1924 func_set_system_config_$config " ` cat $filename ` " " ` cat $current_status_file ` "
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ piratebox_install_sh=/opt/piratebox/bin/install_piratebox.sh
2323func_read_system_config_piratebox_hostname () {
2424 local path=$1 ; shift
2525
26- echo " Extracting HOST parameter from piratebox.conf "
26+ echo " Extracting HOST parameter from $piratebox_config "
2727 config_line=$( grep HOST=\" $piratebox_config )
2828 # extract value
2929 config_line=${config_line# HOST=\" }
@@ -39,7 +39,7 @@ func_set_system_config_piratebox_hostname(){
3939 local old_value=$1 ; shift
4040
4141 echo " Changing hostname for PirateBox with install_piratebox.sh"
42- $piratebox_install_sh " $piratebox_config " hostname " $1 "
42+ . $piratebox_install_sh " $piratebox_config " hostname " $value "
4343}
4444
4545
@@ -50,7 +50,7 @@ func_set_system_config_piratebox_hostname(){
5050func_compare_and_set_piratebox_hostname (){
5151
5252 auto_config_lookup_and_set " $piratebox_hostname_myself " \
53- " $cfg_auto_folder /$piratebox_hostename_config_file " \
54- " $cfg_tmp_folder /$piratebox_hostename_config_file "
53+ " $cfg_auto_folder /$piratebox_hostname_config_file " \
54+ " $cfg_tmp_folder /$piratebox_hostname_config_file "
5555
5656}
Original file line number Diff line number Diff line change @@ -17,15 +17,16 @@ librarybox_ftp_config_file="librarybox_ftp.txt"
1717
1818# FTP configuration is currently located in the hook
1919# librarybox_config=/opt/piratebox/conf/piratebox.conf
20- piratebox_config=/opt/piratebox/conf/hook_custom.conf
20+ # ## duplicate variable name with different content
21+ librarybox_ftp_piratebox_config=/opt/piratebox/conf/hook_custom.conf
2122
2223# Read configuration out of the system and save it to librarybox_ftp_system_config depending on the
2324# parameter
2425func_read_system_config_librarybox_ftp () {
2526 local path=$1 ; shift
2627
27- echo " Extracting FTP parameter from $piratebox_config "
28- config_line=$( grep FTP_ENABLED=\" $piratebox_config )
28+ echo " Extracting FTP parameter from $librarybox_ftp_piratebox_config "
29+ config_line=$( grep FTP_ENABLED=\" $librarybox_ftp_piratebox_config )
2930 # extract value
3031 config_line=${config_line# FTP_ENABLED=\" }
3132 config_value=${config_line% \" }
@@ -40,7 +41,7 @@ func_set_system_config_librarybox_ftp(){
4041 local old_value=$1 ; shift
4142
4243 echo " Changing ftp for LibraryBox"
43- sed " s|FTP_ENABLED=\" $old_value \" |FTP_ENABLED=\" $value \" |" -i $piratebox_config
44+ sed " s|FTP_ENABLED=\" $old_value \" |FTP_ENABLED=\" $value \" |" -i $librarybox_ftp_piratebox_config
4445
4546}
4647
You can’t perform that action at this time.
0 commit comments